aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/common.c
Commit message (Collapse)AuthorAge
...
* Fix a couple of places where psql might fail to report a suitable errorTom Lane2008-08-16
| | | | | if PQexec returns NULL. These don't seem significant enough to be worth back-patching, but they ought to get fixed ...
* Move the "instr_time" typedef and associated macros into a new headerTom Lane2008-05-14
| | | | | | | | | file portability/instr_time.h, and add a couple more macros to eliminate some abstraction leakage we formerly had. Also update psql to use this header instead of its own copy of nearly the same code. This commit in itself is just code cleanup and shouldn't change anything. It lays some groundwork for the upcoming function-stats patch, though.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: theTom Lane2007-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2 initdb and psql if they are run with an 8.3beta1 libpq.so. For the moment we can rearrange the order of enum pg_enc to keep the same number for everything except PG_JOHAB, which isn't a problem since there are no direct references to it in the 8.2 programs anyway. (This does force initdb unfortunately.) Going forward, we want to fix things so that encoding IDs can be changed without an ABI break, and this commit includes the changes needed to allow libpq's encoding IDs to be treated as fully independent of the backend's. The main issue is that libpq clients should not include pg_wchar.h or otherwise assume they know the specific values of libpq's encoding IDs, since they might encounter version skew between pg_wchar.h and the libpq.so they are using. To fix, have libpq officially export functions needed for encoding name<=>ID conversion and validity checking; it was doing this anyway unofficially. It's still the case that we can't renumber backend encoding IDs until the next bump in libpq's major version number, since doing so will break the 8.2-era client programs. However the code is now prepared to avoid this type of problem in future. Note that initdb is no longer a libpq client: we just pull in the two source files we need directly. The patch also fixes a few places that were being sloppy about checking for an unrecognized encoding name.
* In psql, when running a SELECT query using a cursor, flush the queryNeil Conway2007-06-22
| | | | | | output after each FETCH. This ensures that incremental results are available to clients that are executing long-running SELECT queries via the FETCH_COUNT feature.
* Don't write timing output in quiet mode.Magnus Hagander2007-04-16
| | | | Merlin Moncure
* Normalize fgets() calls to use sizeof() for calculating the buffer sizePeter Eisentraut2007-02-08
| | | | | | | where possible, and fix some sites that apparently thought that fgets() will overwrite the buffer by one byte. Also add some strlcpy() to eliminate some weird memory handling.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* enable \timing oputput for \copy commandsAndrew Dunstan2006-12-16
|
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Remove separate strdup.h header file; it's redundant with port.h.Tom Lane2006-09-27
|
* Dept. of second thoughts: if query fails part way through, shut downTom Lane2006-08-29
| | | | the pager before reporting the error.
* Create a FETCH_COUNT parameter that causes psql to execute SELECT-likeTom Lane2006-08-29
| | | | | | | | queries via a cursor, fetching a limited number of rows at a time and therefore not risking exhausting memory. A disadvantage of the scheme is that 'aligned' output mode will align each group of rows independently leading to odd-looking output, but all the other output formats work reasonably well. Chris Mair, with some additional hacking by moi.
* Invent an assign-hook mechanism for psql variables similar to the oneTom Lane2006-08-29
| | | | | | | | | existing for backend GUC variables, and use this to eliminate repeated fetching/parsing of psql variables in psql's inner loops. In a trivial test with lots of 'select 1;' commands, psql's CPU time went down almost 10%, although of course the effect on total elapsed time was much less. Per discussion about how to ensure the upcoming FETCH_COUNT patch doesn't cost any performance when not being used.
* Add the ability to create indexes 'concurrently', that is, withoutTom Lane2006-08-25
| | | | | blocking concurrent writes to the table. Greg Stark, with a little help from Tom Lane.
* Cause psql to report both the returned data and the command status tagTom Lane2006-08-13
| | | | for INSERT/UPDATE/DELETE RETURNING. Per discussion.
* Make the psql line counter 64-bit so it can handle files > 4gig lines.Bruce Momjian2006-08-11
| | | | David Fetter
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Fix memory leak introduced in the prior commit, detected by Tom Lane.Alvaro Herrera2006-06-30
|
* Fix use-after-free error reported by Neil Conway.Alvaro Herrera2006-06-30
|
* Clean up psql's control-C handling to avoid longjmp'ing out of randomTom Lane2006-06-14
| | | | | | | | | places --- that risks corrupting data structures, losing sync with the backend, etc. We now longjmp only from calls to readline, fgets, and fread, which we assume are coded to protect themselves against interrupts at undesirable times. This requires adding explicit tests for cancel_pressed in long-running loops, but on the whole it's far cleaner. Martijn van Oosterhout and Tom Lane.
* Support binary COPY through psql. Also improve detection of write errorsTom Lane2006-05-26
| | | | during COPY OUT. Andreas Pflug, some editorialization by moi.
* Code review for standard_conforming_strings patch. Fix it so it does notTom Lane2006-05-11
| | | | | | | throw warnings for 100%-SQL-standard constructs, clean up some minor infelicities, try to un-break ecpg to the best of my ability. (It's not clear how ecpg is going to find out the setting of standard_conforming_strings, though.) I think pg_dump still needs work, too.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Enable standard_conforming_strings to be turned on.Bruce Momjian2006-03-06
| | | | Kevin Grittner
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Improve pg_dump and psql to use libpq's newer COPY support routines,Tom Lane2006-03-03
| | | | | instead of the old deprecated ones. Volkan Yazici, with some editorializing by moi.
* Fix more fallout from line-wrap patch, to wit, arbitrarily changingTom Lane2006-02-12
| | | | | | | the API of PQdsplen without bothering to fix its callers. Although ReportSyntaxErrorPosition could probably do with more smarts about handling control characters, for the moment I'll just get it back to handling tabs consistently.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Ensure that we only create one ConsoleCtrlHandler per psql process,Tom Lane2005-11-04
| | | | | so as to avoid performance issues and possible ultimate crash on long psql scripts. Per Merlin Moncure.
* Disable expanded mode only for \d tablename, not for all backslashBruce Momjian2005-10-27
| | | | commands. Per complaint that \df+ is clearer in expanded mode.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* The patch updates the documentation to reflect the fact that higher valuesBruce Momjian2005-10-13
| | | | | | | | | | | | | | | | | | | | of client_min_messages (fatal + panic) are valid and also fixes a slight issue with how psql tried to display error messages that aren't sent to the client. We often tell people to ignore errors in response to requests for things like "drop if exists", but there's no good way to completely hide this without upping client_min_messages past ERROR. When running a file like SET client_min_messages TO 'FATAL'; DROP TABLE doesntexist; with "psql -f filename" you get an error prefix of "psql:/home/username/filename:3" even though there is no error message to prefix because it isn't sent to the client. Kris Jurka
* Clean up some messages and fix missing translation support. Option --logPeter Eisentraut2005-10-04
| | | | renamed to --log-file for clarity.
* Fix interaction between psql \set AUTOCOMMIT and "ON_ERROR_ROLLBACK"Bruce Momjian2005-09-20
| | | | by properly updating transaction state after AUTOCOMMIT.
* Make REINDEX DATABASE do what one would expect, namely reindex all indexesTom Lane2005-06-22
| | | | | | | in the database. The old behavior (reindex system catalogs only) is now available as REINDEX SYSTEM. I did not add the complementary REINDEX USER case since there did not seem to be consensus for this, but it would be trivial to add later. Per recent discussions.
* Two-phase commit. Original patch by Heikki Linnakangas, with additionalTom Lane2005-06-17
| | | | hacking by Alvaro Herrera and Tom Lane.
* Add -L option to psql to log sessions.Bruce Momjian2005-06-14
| | | | Lorne Sunley
* Per discussion on -hackers, this patch changes psql's "expanded" outputNeil Conway2005-06-13
| | | | | | mode to only affect the presentation of normal query results, not the output of psql slash commands. Documentation updated. I also made some unrelated minor psql cleanup. Per suggestion from Stuart Cooper.
* More Win32 tilde code comments.Bruce Momjian2005-06-10
|
* Add comment on tilde expansion.Bruce Momjian2005-06-10
|
* Support only octal for psql PROMPT values, rather than the confusingBruce Momjian2005-05-30
| | | | | | hex/decimal/octal. Documentation already updated. BACKWARD COMPATIBLE CHANGE
* Add psql \set ON_ERROR_ROLLBACK to allow statements in a transaction toBruce Momjian2005-04-28
| | | | | error without affecting the entire transaction. Valid values are "on|interactive|off".
* Use _() macro consistently rather than gettext(). Add translationBruce Momjian2005-02-22
| | | | macros around strings that were missing them.
* Update copyrights that were missed.Bruce Momjian2005-01-01
|
* That's just the lovely way windows handles a "segfault". Gotta be reallyBruce Momjian2004-11-01
| | | | | | | | | | | | interesting for MS to catch all those dumps... Anyway. Oops. Seems I ran my regression tests with the old psql, and just managed to update the backend, when I tested that patch. Turns out there are codepaths where we'd access the Critical Section before it was initialized. Attached patch breaks the initializeation off to a separate part and adds that one to a much earlier position in the program. Magnus Hagander
* Invent a new, more thread-safe version of PQrequestCancel, called PQcancel.Tom Lane2004-10-30
| | | | | | Use this new function in psql. Implement query cancellation in psql for Windows. Code by Magnus Hagander, documentation and minor editorialization by Tom Lane.
* Cosmetic improvements/code cleanup:Neil Conway2004-10-10
| | | | | | | | | | | - replace some function signatures of the form "some_type foo()" with "some_type foo(void)" - replace a few instances of a literal 0 being used as a NULL pointer; there are more instances of this in the code, but I just fixed a few - in src/backend/utils/mb/wstrncmp.c, replace K&R style function declarations with ANSI style, remove use of 'register' keyword - remove an "extern" modifier that was applied to a function definition (rather than a declaration)
* Fix some shortcomings in psql's autocommit-off mode concerning detectionTom Lane2004-09-20
| | | | | | | of commands for which a transaction block should not be forced. Recognize VACUUM and other PreventTransactionChain commands; handle nested /* .. */ comments correctly; handle multibyte encodings correctly. Michael Paesold with some kibitzing from Tom Lane.