summaryrefslogtreecommitdiff
path: root/src/bin/psql
AgeCommit message (Collapse)Author
2010-10-26Fix up some oversights in psql's Unicode-escape support.Tom Lane
Original patch failed to include new exclusive states in a switch that needed to include them; and also was guilty of very fuzzy thinking about how to handle error cases. Per bug #5729 from Alan Choi.
2010-09-30Translation updates for 9.0.1Peter Eisentraut
2010-09-28Fix another small oversight in command_no_begin patch.Tom Lane
Need a "return false" to prevent tests from continuing after we've moved the "query" pointer. As it stood, it'd accept "DROP DISCARD ALL" as a match.
2010-09-28Only DISCARD ALL should be in the command_no_begin list.Itagaki Takahiro
We allowes DISCARD PLANS and TEMP in a transaction.
2010-09-28Add DISCARD to the command_no_begin list for AUTOCOMMIT=off.Itagaki Takahiro
Backpatch to 8.3. Reported by Sergey Burladyan.
2010-09-22Convert cvsignore to gitignore, and add .gitignore for build targets.Magnus Hagander
2010-09-16Translation updates for 9.0.0Peter Eisentraut
2010-08-16Fix psql's copy of utf2ucs() to match the backend's copy exactly;Tom Lane
in particular, propagate a fix in the test to see whether a UTF8 character has length 4 bytes. This is likely of little real-world consequence because 5-or-more-byte UTF8 sequences are not supported by Postgres nor seen anywhere in the wild, but still we may as well get it right. Problem found by Joseph Adams. Bug is aboriginal, so back-patch all the way.
2010-07-29Translation updates for 9.0beta4Peter Eisentraut
2010-07-28Show psql timing output even in quiet modePeter Eisentraut
These two settings ought to be independent of each other.
2010-07-08Translation updates for 9.0beta3Peter Eisentraut
2010-07-06pgindent run for 9.0, second runBruce Momjian
2010-07-05Split the LDFLAGS make variable into two parts: LDFLAGS is now used forTom Lane
linking both executables and shared libraries, and we add on LDFLAGS_EX when linking executables or LDFLAGS_SL when linking shared libraries. This provides a significantly cleaner way of dealing with link-time switches than the former behavior. Also, make sure that the various platform-specific %.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that before. (I did not add these variables for the platforms that invoke $(LD) directly, however. It's not clear if we can do that safely, since for the most part we assume these variables use CC command-line syntax.) Per gripe from Aaron Swenson and subsequent investigation.
2010-06-14Fix typo in Japanese translation for psql "Use \d+ to list them."Itagaki Takahiro
2010-06-07Ensure default-only storage parameters for TOAST relationsItagaki Takahiro
to be initialized with proper values. Affected parameters are fillfactor, analyze_threshold, and analyze_scale_factor. Especially uninitialized fillfactor caused inefficient page usage because we built a StdRdOptions struct in which fillfactor is zero if any reloption is set for the toast table. In addition, we disallow toast.autovacuum_analyze_threshold and toast.autovacuum_analyze_scale_factor because we didn't actually support them; they are always ignored. Report by Rumko on pgsql-bugs on 12 May 2010. Analysis by Tom Lane and Alvaro Herrera. Patch by me. Backpatch to 8.4.
2010-06-03Translation updates for 9.0beta2Peter Eisentraut
2010-05-30Change the notation for calling functions with named parameters fromTom Lane
"val AS name" to "name := val", as per recent discussion. This patch catches everything in the original named-parameters patch, but I'm not certain that no other dependencies snuck in later (grepping the source tree for all uses of AS soon proved unworkable). In passing I note that we've dropped the ball at least once on keeping ecpg's lexer (as opposed to parser) in sync with the backend. It would be a good idea to go through all of pgc.l and see if it's in sync now. I didn't attempt that at the moment.
2010-05-28Abort a FETCH_COUNT-controlled query if we observe any I/O error on theTom Lane
output stream. This typically indicates that the user quit out of $PAGER, or that we are writing to a file and ran out of disk space. In either case we shouldn't bother to continue fetching data. Stephen Frost
2010-05-26Fix psql help: \da+ is same as \da, but \daS is not.Robert Haas
Noted by Stephen Frost.
2010-05-21Unbreak \h; can't do strlen(NULL).Robert Haas
This was broken by the following commmit. Although the original commit was backpatched all the way to 7.4, this particular bug exists only in the version applied to HEAD. http://archives.postgresql.org/pgsql-committers/2010-05/msg00058.php
2010-05-13Translation updatePeter Eisentraut
2010-05-12Add PGFILEDESC description to Makefiles for all /contrib executables.Bruce Momjian
Add PGAPPICON to all executable makefiles.
2010-05-09Suppress signed-vs-unsigned-char warning.Tom Lane
2010-05-09Adjust comments about avoiding use of printf's %.*s.Tom Lane
My initial impression that glibc was measuring the precision in characters (which is what the Linux man page says it does) was incorrect. It does take the precision to be in bytes, but it also tries to truncate the string at a character boundary. The bottom line remains the same: it will mess up if the string is not in the encoding it expects, so we need to avoid %.*s anytime there's a significant risk of that. Previous code changes are still good, but adjust the comments to reflect this knowledge. Per research by Hernan Gonzalez.
2010-05-08Work around a subtle portability problem in use of printf %s format.Tom Lane
Depending on which spec you read, field widths and precisions in %s may be counted either in bytes or characters. Our code was assuming bytes, which is wrong at least for glibc's implementation, and in any case libc might have a different idea of the prevailing encoding than we do. Hence, for portable results we must avoid using anything more complex than just "%s" unless the string to be printed is known to be all-ASCII. This patch fixes the cases I could find, including the psql formatting failure reported by Hernan Gonzalez. In HEAD only, I also added comments to some places where it appears safe to continue using "%.*s".
2010-05-05Fix psql to not go into infinite recursion when expanding a variable thatTom Lane
refers to itself (directly or indirectly). Instead, print a message when recursion is detected, and don't expand the repeated reference. Per bug #5448 from Francis Markham. Back-patch to 8.0. Although the issue exists in 7.4 as well, it seems impractical to fix there because of the lack of any state stack that could be used to track active expansions.
2010-04-30Fix a couple of places where the result of fgets() wasn't checked.Tom Lane
This is mostly to suppress compiler warnings, although in principle the cases could result in undesirable behavior. Martin Pitt
2010-04-07psql tab completion for ALTER DEFAULT PRIVILEGES and USER MAPPING FOR PUBLIC.Itagaki Takahiro
2010-04-05Assorted tab-completion improvements in psql.Itagaki Takahiro
Add missing completions for: - ALTER SEQUENCE name OWNER TO - ALTER TYPE name RENAME TO - ALTER VIEW name ALTER COLUMN - ALTER VIEW name OWNER TO - ALTER VIEW name SET SCHEMA Fix wrong completions for: - ALTER FUNCTION/AGGREGATE name (arguments) ... "(arguments)" has been ignored. - ALTER ... SET SCHEMA "SCHEMA" has been considered as a variable name.
2010-04-03\ddp should be recognized as such even if user appends S or + to it.Tom Lane
Those options do nothing right now, but might be wanted later, and in any case it's confusing for the command to be interpreted as \dd if anything is appended. Per Jaime Casanova.
2010-03-11Modify psql's \d printout to fold exclusion constraints in with regularTom Lane
indexes, rather than printing them twice. Per my gripe when the exclusion constraint feature was committed.
2010-03-11Simplify a couple of pg_dump and psql \d queries about index constraintsTom Lane
by joining to pg_constraint.conindid, instead of the former technique of joining indirectly through pg_depend. This is much more straightforward and probably faster as well. I had originally desisted from changing these queries when conindid was added because I was worried about losing performance, but if we join on conrelid as well as conindid then the index on conrelid can be used when pg_constraint is large.
2010-03-08Return proper exit code (3) from psql when ON_ERROR_STOP=on andBruce Momjian
--single-transaction are both used and the failure happens in commit, e.g. failed deferred trigger. Also properly free BEGIN/COMMIT result structures from --single-transaction. Per report from Dominic Bevacqua
2010-03-07Revert patch for --psqlrc=FILENAME in psql.Magnus Hagander
2010-03-06Add --psqlrc=FILENAME parameter to psql, to process an explicitly namedMagnus Hagander
file instead of ~/.psqlrc on startup.
2010-03-01Fix translation of strings in psql \d output (translation in headers worked,Heikki Linnakangas
but not in cells).
2010-03-01Fix numericlocale psql option when used with a null string and latex and troffHeikki Linnakangas
formats; a null string must not be formatted as a numeric. The more exotic formats latex and troff also incorrectly formatted all strings as numerics when numericlocale was on. Backpatch to 8.1 where numericlocale option was added. This fixes bug #5355 reported by Andy Lester.
2010-02-26pgindent run for 9.0Bruce Momjian
2010-02-19Translation updates for 9.0alpha4Peter Eisentraut
2010-02-17Stamp HEAD as 9.0devel, and update various places that were referring to 8.5Tom Lane
(hope I got 'em all). Per discussion, this release will be 9.0 not 8.5.
2010-02-17Support new syntax and improve handling of parentheses in psql tab-completion.Itagaki Takahiro
Newly supported syntax are: - ALTER {TABLE|INDEX|TABLESPACE} {SET|RESET} with options - ALTER TABLE ALTER COLUMN {SET|RESET} with options - ALTER TABLE ALTER COLUMN SET STORAGE - CREATE INDEX CONCURRENTLY - CREATE INDEX ON (without name) - CREATE INDEX ... USING with pg_am.amname instead of hard-corded names - CREATE TRIGGER with events - DROP AGGREGATE function with arguments
2010-02-16Replace the pg_listener-based LISTEN/NOTIFY mechanism with an in-memory queue.Tom Lane
In addition, add support for a "payload" string to be passed along with each notify event. This implementation should be significantly more efficient than the old one, and is also more compatible with Hot Standby usage. There is not yet any facility for HS slaves to receive notifications generated on the master, although such a thing is possible in future. Joachim Wieland, reviewed by Jeff Davis; also hacked on by me.
2010-02-16Prevent psql version banner from being printed by the \c command if theBruce Momjian
versions match, per report from Peter.
2010-02-15Add psql tab completion for DO blocks.Itagaki Takahiro
Also adjust documentation of DO. Patch from David Fetter and subsequent discussion.
2010-02-05Modify recently added PQconnectdbParams() with new argument, expand_dbname.Joe Conway
If expand_dbname is non-zero and dbname contains an = sign, it is taken as a conninfo string in exactly the same way as if it had been passed to PQconnectdb. This is equivalent to the way PQsetdbLogin() works, allowing PQconnectdbParams() to be a complete alternative. Also improve the way the new function is called from psql and replace a previously missed call to PQsetdbLogin() in psql. Additionally use PQconnectdbParams() for pg_dump and friends, and the bin/scripts command line utilities such as vacuumdb, createdb, etc. Finally, update the documentation for the new parameter, as well as the nuances of precedence in cases where key words are repeated or duplicated in the conninfo string.
2010-01-30Fix memory leakage introduced into print_aligned_text by 8.4 changesTom Lane
(failure to free col_lineptrs[] array elements) and exacerbated in the current devel cycle (failure to free "wrap"). This resulted in moderate bloat of psql over long script runs. Noted while testing bug #5302, although what the reporter was complaining of was backend-side leakage.
2010-01-29Allow psql variables to be interpolated with literal or identifier escaping.Robert Haas
Loosely based on a patch by Pavel Stehule.
2010-01-28Type table featurePeter Eisentraut
This adds the CREATE TABLE name OF type command, per SQL standard.
2010-01-28Introduce two new libpq connection functions, PQconnectdbParams andJoe Conway
PQconnectStartParams. These are analogous to PQconnectdb and PQconnectStart respectively. They differ from the legacy functions in that they accept two NULL-terminated arrays, keywords and values, rather than conninfo strings. This avoids the need to build the conninfo string in cases where it might be inconvenient to do so. Includes documentation. Also modify psql to utilize PQconnectdbParams rather than PQsetdbLogin. This allows the new config parameter application_name to be set, which in turn is displayed in the pg_stat_activity view and included in CSV log entries. This will also ensure both new functions get regularly exercised. Patch by Guillaume Lelarge with review and minor adjustments by Joe Conway.
2010-01-25Add note that PREPARE TRANSACTION is for transaction managers, notHeikki Linnakangas
regular applications. Also add a comment pointing out that tab-complition for PREPARE TRANSACTION is missing on purpose.