summaryrefslogtreecommitdiff
path: root/src/bin/psql
Commit message (Collapse)AuthorAgeFilesLines
* Allow \pset and \x, \t to use boolean constants on/off, rather than justBruce Momjian2007-03-031-7/+36
| | | | | | toggle. Chad Wagner
* Add psql \prompt capability.Bruce Momjian2007-02-233-5/+58
| | | | Chad Wagner
* Identify schema of inherited table in psql \d when necessary.Peter Eisentraut2007-02-201-2/+2
| | | | by Bernd Helmle
* Fix up foreign-key mechanism so that there is a sound semantic basis for theTom Lane2007-02-141-13/+5
| | | | | | | | | | | | | | | | | | | | | equality checks it applies, instead of a random dependence on whatever operators might be named "=". The equality operators will now be selected from the opfamily of the unique index that the FK constraint depends on to enforce uniqueness of the referenced columns; therefore they are certain to be consistent with that index's notion of equality. Among other things this should fix the problem noted awhile back that pg_dump may fail for foreign-key constraints on user-defined types when the required operators aren't in the search path. This also means that the former warning condition about "foreign key constraint will require costly sequential scans" is gone: if the comparison condition isn't indexable then we'll reject the constraint entirely. All per past discussions. Along the way, make the RI triggers look into pg_constraint for their information, instead of using pg_trigger.tgargs; and get rid of the always error-prone fixed-size string buffers in ri_triggers.c in favor of building up the RI queries in StringInfo buffers. initdb forced due to columns added to pg_constraint and pg_trigger.
* Normalize fgets() calls to use sizeof() for calculating the buffer sizePeter Eisentraut2007-02-083-19/+18
| | | | | | | 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.
* Replace some strncpy() by strlcpy().Peter Eisentraut2007-02-071-6/+3
|
* Pass modern COPY syntax to backend, since copy (query) does not accept old ↵Andrew Dunstan2007-02-051-14/+10
| | | | syntax. Per complaint from Michael Fuhr.
* Wording cleanup for error messages. Also change can't -> cannot.Bruce Momjian2007-02-011-2/+2
| | | | | | | | | | | | | | Standard English uses "may", "can", and "might" in different ways: may - permission, "You may borrow my rake." can - ability, "I can lift that log." might - possibility, "It might rain today." Unfortunately, in conversational English, their use is often mixed, as in, "You may use this variable to do X", when in fact, "can" is a better choice. Similarly, "It may crash" is better stated, "It might crash".
* List disabled triggers separately in psql's "\d <table>" output.Neil Conway2007-01-201-3/+56
| | | | | Previously, disabled triggers were not displayed any differently than enabled ones, which was quite misleading. Patch from Brendan Jurd.
* Teach psql's \lo slash commands to respect quiet mode, and to outputNeil Conway2007-01-201-4/+38
| | | | HTML in HTML mode. Patch from Jeremy Drake.
* Allow Borland CC to compile libpq and psql.Bruce Momjian2007-01-111-3/+32
| | | | L Bayuk
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-0533-67/+67
| | | | back-stamped for this.
* fflush the \o file, if any, after each backslash command. We alreadyTom Lane2006-12-281-3/+6
| | | | | do this for ordinary SQL commands, so it seems consistent to do it for backslash commands too. Per gripe from Rajesh Kumar Mallah.
* Print combining characters (those reported as having zero width byTom Lane2006-12-271-20/+15
| | | | | | PQdsplen()) normally, instead of replacing them by \uXXXX sequences. Assume that they in fact occupy zero screen space for formatting purposes. Per gripe from Michael Fuhr and ensuing discussion.
* Make HISTCONTROL=ignoredups work again (broken by misordering ofTom Lane2006-12-241-7/+7
| | | | operations during recent code refactoring). Per bug #2840 from Ned Crigler.
* fix thinko in placement of TimeValStruct typedef in Windows case, as ↵Andrew Dunstan2006-12-181-3/+3
| | | | reported by Magnus.
* enable \timing oputput for \copy commandsAndrew Dunstan2006-12-163-28/+47
|
* Translation updatesPeter Eisentraut2006-12-021-612/+791
|
* Fix psql's \copy command to ensure that it cycles libpq back to the idle stateTom Lane2006-11-241-1/+13
| | | | | | | | | (in particular, causing the ReadyForQuery message to be eaten) before returning from do_copy. The only known consequence of failing to do so is that get_prompt might show a wrong result for the %x transaction status escape, as reported by Bernd Helmle; but it's possible there are other issues. Back-patch as far as 7.4, the oldest version supporting %x.
* Translation updatesPeter Eisentraut2006-11-245-1762/+2189
|
* Get rid of retail definitions of HAVE_STRDUP and HAVE_VSNPRINTF inTom Lane2006-11-212-2/+2
| | | | | some of the Windows-only makefiles; the correct place to assert these things is pg_config.h.win32. Per bug #2677.
* Fix a memory leak in psql: we'd leak a few PGresult handles ifNeil Conway2006-11-081-1/+8
| | | | | | a connectivity error occurred while executing one of the queries for "\d <table>". Not serious, but still worth fixing. Patch from Brendan Jurd.
* Translations updatePeter Eisentraut2006-10-216-3090/+4354
|
* MSVC/BCC Win32 compiler fixes.Bruce Momjian2006-10-101-0/+7
| | | | Hiroshi Saito
* Move processNamePattern into dumputils.c in preparation for using it inTom Lane2006-10-091-260/+58
| | | | | | | pg_dump as well as psql. Since psql already uses dumputils.c, while there's not any code sharing in the other direction, this seems the easiest way. Also, fix misinterpretation of patterns using regex | by adding parentheses (same bug found previously in similar_escape()). This should be backpatched.
* Fix ancient oversight in psql's \d pattern processing code: when seeing twoTom Lane2006-10-071-10/+13
| | | | | | quote chars inside quote marks, should emit one quote *and stay in inquotes mode*. No doubt the lack of reports of this have something to do with the poor documentation of the feature ...
* Message style improvementsPeter Eisentraut2006-10-063-11/+11
|
* pgindent run for 8.2.Bruce Momjian2006-10-0416-375/+407
|
* Remove separate strdup.h header file; it's redundant with port.h.Tom Lane2006-09-271-4/+1
|
* Fix bugs in plpgsql and ecpg caused by assuming that isspace() would onlyTom Lane2006-09-221-3/+3
| | | | | | | | | return true for exactly the characters treated as whitespace by their flex scanners. Per report from Victor Snezhko and subsequent investigation. Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally able to stop using it.
* Extend COPY to support COPY (SELECT ...) TO ...Tom Lane2006-08-301-1/+24
| | | | Bernd Helmle
* Dept. of second thoughts: if query fails part way through, shut downTom Lane2006-08-291-4/+13
| | | | the pager before reporting the error.
* Create a FETCH_COUNT parameter that causes psql to execute SELECT-likeTom Lane2006-08-295-483/+831
| | | | | | | | 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-2912-266/+407
| | | | | | | | | 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.
* Make saveHistory work properly on OS X when HISTFILE is set to /dev/null.Tom Lane2006-08-271-2/+9
| | | | Per discussion with Martin Atukunda.
* Add the ability to create indexes 'concurrently', that is, withoutTom Lane2006-08-252-18/+74
| | | | | 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-131-24/+42
| | | | for INSERT/UPDATE/DELETE RETURNING. Per discussion.
* Make the psql line counter 64-bit so it can handle files > 4gig lines.Bruce Momjian2006-08-113-6/+6
| | | | David Fetter
* Suppress MSVC warnings about weak functions by usingBruce Momjian2006-08-091-5/+5
| | | | | | _CRT_SECURE_NO_DEPRECATE. Hiroshi Saito
* Aggregate functions now support multiple input arguments. I also tookTom Lane2006-07-271-7/+12
| | | | | | | | the opportunity to treat COUNT(*) as a zero-argument aggregate instead of the old hack that equated it to COUNT(1); this is materially cleaner (no more weird ANYOID cases) and ought to be at least a tiny bit faster. Original patch by Sergey Koposov; review, documentation, simple regression tests, pg_dump and psql support by moi.
* Mark a few functions as static or NOT_USED.Bruce Momjian2006-07-182-5/+5
|
* Improve psql's \df slash command to include the argument names and modesNeil Conway2006-07-171-3/+30
| | | | | (OUT or INOUT) of the function. Patch from David Fetter, editorialization by Neil Conway.
* Fix a few places where $Id$ and $Header$ CVS tags had crept into theTom Lane2006-07-161-1/+1
| | | | source tree. They should all be $PostgreSQL$ of course.
* Fix some missing inclusions identified with new pgcheckdefines tool.Tom Lane2006-07-152-10/+12
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-1414-45/+14
|
* Fix a passel of recently-committed violations of the rule 'thou shaltTom Lane2006-07-142-4/+2
| | | | | have no other gods before c.h'. Also remove some demonstrably redundant #include lines, mostly of <errno.h> which was added to c.h years ago.
* Fix memory leak introduced in the prior commit, detected by Tom Lane.Alvaro Herrera2006-06-301-1/+3
|
* Fix use-after-free error reported by Neil Conway.Alvaro Herrera2006-06-301-9/+11
|
* Move setup_cancel_handler() up near start of psql main(), where theTom Lane2006-06-211-6/+6
| | | | | setup_win32_locks() call formerly was, to ensure that cancelConnLock is valid when it needs to be. Per Yoshiyuki Asaba.
* Clean up psql variable code a little: eliminate unnecessary tests inTom Lane2006-06-211-21/+20
| | | | | | | GetVariable() and be consistent about treatment of the list header. Motivated by noticing strspn() taking an unreasonable percentage of runtime --- the call removed from GetVariable() was the only one that could be in a high-usage path ...