Commit Graph

1289 Commits

Author SHA1 Message Date
Tom Lane e7b498bd5e Recent patch doesn't compile without <limits.h> 2008-05-16 18:35:38 +00:00
Bruce Momjian 9263d86f59 Update psql startup banner to be shorter, suggest "help" for help.
Add a few "help" entries.

Move \g help entry into "General".

Update psql version mismatch warning text.

Joshua D. Drake
2008-05-16 17:17:00 +00:00
Bruce Momjian 43ee22826b Add detection of psql pager to trigger on wide output. Also add pager
detection for wrapped lines or lines with newlines that need pager to
display.
2008-05-16 16:59:05 +00:00
Tom Lane 3bc25384d7 Move the "instr_time" typedef and associated macros into a new header
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.
2008-05-14 19:10:29 +00:00
Bruce Momjian 719a115874 Reorgnize psql \? help output, to reduce the size of the "General"
heading at the top;   broken into more sections now.
2008-05-14 15:30:22 +00:00
Alvaro Herrera a61b2464fa Change \du to use the new printTable API, improving the situation of very wide
tables.

Brendan Jurd, with some help from me.
2008-05-13 00:23:17 +00:00
Alvaro Herrera e6a64bd3b6 Fix a bug in the previous patch, which caused the title pointer to be used
before it was actually set.
2008-05-13 00:14:11 +00:00
Alvaro Herrera 1e9199e84c Improve psql's internal print.c code by introducing an actual print API.
Provides for better code readability, but mainly this is infrastructure changes
to allow further changes such as arbitrary footers on printed tables.  Also,
the translation status of each element in the table is more easily customized.

Brendan Jurd, with some editorialization by me.
2008-05-12 22:59:58 +00:00
Tom Lane 125ed6853e Restore psql's former behavior that padding spaces to the right of the last
output column are not emitted.  (That change already caused more noise in
the regression test output files than I would like.)  Provide some needed
editorial help for comments, clean up code formatting.
2008-05-10 03:31:58 +00:00
Peter Eisentraut d35c56ed9f Add "%option noinput" to the scanners to avoid compiler warnings. GCC 4.3
began to realize that the input() function isn't used and printed warnings.
2008-05-09 15:36:31 +00:00
Tom Lane e1435983b8 Fix memory stomp that's turning the whole buildfarm pink: you can't hack up
pg_wcsformat without changing pg_wcssize to match.  Add some comments to
try to make that clearer, and make a couple other minor editorializations.
2008-05-09 05:25:04 +00:00
Bruce Momjian eabd1b2ee8 Have psql output tab as the proper number of spaces, rather than \x09. 2008-05-08 19:11:36 +00:00
Bruce Momjian 5adf98ae24 Add psql '\pset format wrapped' mode to wrap output to screen width, or
file/pipe output too if \pset columns' is set.

Bryce Nesbitt
2008-05-08 17:04:26 +00:00
Bruce Momjian 0f5651a90f Have boolean pset values checked against typical boolean values, rather
than only 'off'.
2008-05-07 02:33:52 +00:00
Andrew Dunstan a87f15d506 Display ACLS using multiple lines for psql's \z. Brendan Jurd. 2008-05-05 01:21:03 +00:00
Andrew Dunstan c0b1b01ef5 Show enum values in psql's \dt+. David Fetter. 2008-05-05 00:11:31 +00:00
Heikki Linnakangas 72e1d28afd Show relation size in verbose (e.g. \d+) output.
Dickson S. Guedes
2008-05-02 10:16:16 +00:00
Peter Eisentraut 6f093f3825 One-letter backslash commands now need a space before the first argument.
This has been the only documented and encouraged syntax for a long time, and
with extension facilities such as aliases being proposed, it is a good time to
clean up the legacy syntax a bit.

Author: Bernd Helmle <mailings@oopsware.de>
2008-05-02 09:27:51 +00:00
Bruce Momjian a9b3e4fa6f Fix comment typo.
Bryce Nesbitt
2008-04-16 18:18:00 +00:00
Alvaro Herrera 10be77c173 Fix indentation in new REFERENCED BY psql output, per Brendan Jurd. 2008-04-14 15:04:20 +00:00
Tom Lane d785b39fbf A small visit from the portability and localization police. 2008-04-05 03:40:15 +00:00
Bruce Momjian b6f0ad4b0e Have psql command 'help' suggest the use of \?, updated version.
Greg Sabino Mullane
2008-04-04 18:00:25 +00:00
Bruce Momjian dc565af454 Allow 'help' in psql to show \? help, for novice assistance.
Greg Sabino Mullane
2008-04-04 17:42:43 +00:00
Tom Lane b65a509746 Show database access privileges in psql's \l command. For \l+, also show
database size, when available to the current user.

Andrew Gilligan
2008-03-30 18:10:20 +00:00
Tom Lane 2be368a5af Display incoming as well as outgoing foreign-key constraints in psql's
\d output for a table.

Kenneth D'Souza, some changes by myself.
2008-03-30 17:50:11 +00:00
Tom Lane 2f6e61b8a6 Improve description of \du and \dg, per suggestion from
Harald Armin Massa.
2008-03-29 19:40:12 +00:00
Tom Lane 5787d50acc Improve psql's tab completion to handle completing attribute names in cases
where the relation name was schema-qualified, for example
	UPDATE foo.bar SET <tab>
Also support cases where the relation name was quoted unnecessarily,
for example
	UPDATE "foo" SET <tab>

Greg Sabino Mullane, slightly simplified by myself.
2008-03-29 19:19:14 +00:00
Tom Lane 039dfbfd5d Reduce the need for frontend programs to include "postgres.h" by refactoring
inclusions in src/include/catalog/*.h files.  The main idea here is to push
function declarations for src/backend/catalog/*.c files into separate headers,
rather than sticking them into the corresponding catalog definition file as
has been done in the past.  This commit only carries out that idea fully for
pg_proc, pg_type and pg_conversion, but that's enough for the moment ---
if pg_list.h ever becomes unsafe for frontend code to include, we'll need
to work a bit more.

Zdenek Kotala
2008-03-27 03:57:34 +00:00
Magnus Hagander 2d7705e85e Include \password in the psql help.
While at it, change the order of the documented options to be
alphabetically again.
2008-03-26 15:24:56 +00:00
Bruce Momjian def329d165 Prevent psql \copy from accepting multiple string parameters, e.g.
test=> \copy billing_data from ../BillingSamplePricerFile.csv with csv
	   header quote as '"' null as 'abc' null as '123'
	\copy: parse error at "null"

Per report from Stephen Frost
2008-03-11 23:30:56 +00:00
Peter Eisentraut 3c9ae7300d Translation updates 2008-01-31 18:04:52 +00:00
Peter Eisentraut 6dfa40d69f Translation updates 2008-01-30 11:05:41 +00:00
Tom Lane f7108ce06b Fix psql \h output for case of no parameters (ie, list all the known commands)
to format properly for the actually needed column width, instead of having
a hard-wired assumption about the longest command name length.  Also make it
respond to the current screen width.  In passing, const-ify the constant
table.
2008-01-20 21:13:55 +00:00
Bruce Momjian 9098ab9e32 Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
Tom Lane df4271fedd Improve the method of localizing column names and other fixed strings in
psql's \d commands and other uses of printQuery().  Previously we would pass
these strings through gettext() and then send them to the server as literals
in the SQL query.  But the code was not set up to handle doubling of quotes in
the strings, causing failure if a translation attempted to use the wrong kind
of quote marks, as indeed is now the case for (at least) the French
translation of \dFp.  Another hazard was that gettext() would translate to
whatever encoding was implied by the client's LC_CTYPE setting, which might be
different from the client_encoding setting, which would probably cause the
server to reject the query as mis-encoded.  The new arrangement is to send the
untranslated ASCII strings to the server, and do the translations inside
printQuery() after the query results come back.  Per report from Guillaume
Lelarge and subsequent discussion.
2007-12-12 21:41:47 +00:00
Tom Lane 1ebff9ba81 Make documentation of -W options more accurate and uniform. 2007-12-11 19:57:32 +00:00
Tom Lane 1161f1ae14 Remove the long-deprecated -u option from psql, since it does nothing very
useful and confuses people who think it is the same as -U.  (Eventually
we might want to re-introduce it as being an alias for -U, but that should
not happen until the switch has actually not been there for a few releases.)
Likewise in pg_dump and pg_restore.  Per gripe from Robert Treat and
subsequent discussion.
2007-12-11 19:01:06 +00:00
Tom Lane e8191d9f23 Fix bogus prompt for password in -u case. Per gripe from Robert Treat. 2007-12-09 19:04:47 +00:00
Tom Lane 4f9bf7fc5a Fix up the PQconnectionUsedPassword mess: create a separate
PQconnectionNeedsPassword function that tells the right thing for whether to
prompt for a password, and improve PQconnectionUsedPassword so that it checks
whether the password used by the connection was actually supplied as a
connection argument, instead of coming from environment or a password file.
Per bug report from Mark Cave-Ayland and subsequent discussion.
2007-12-09 19:01:40 +00:00
Peter Eisentraut 42a0c88ead Translation updates 2007-11-29 08:50:36 +00:00
Peter Eisentraut 3f9ef2bf8c Properly recognize and announce input errors. 2007-11-28 09:17:46 +00:00
Bruce Momjian b85cf684f7 Add more comments about thousands separator handling. 2007-11-22 17:51:39 +00:00
Bruce Momjian d9bc7a3946 Add comments about thousands separator logic. 2007-11-22 15:10:05 +00:00
Bruce Momjian 3894e7cc55 When setting default thousands separator when locale has "", use logic
so new thousands separator doesn't match decimal symbol.
2007-11-21 22:28:18 +00:00
Bruce Momjian 0c2c061eb0 Cleanup for new else/comment handling. 2007-11-16 01:11:04 +00:00
Bruce Momjian 7d4c99b414 Fix pgindent to properly handle 'else' and single-line comments on the
same line;  previous fix was only partial.  Re-run pgindent on files
that need it.
2007-11-15 23:23:44 +00:00
Bruce Momjian fdf5a5efb7 pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
Peter Eisentraut 3adc760fb9 Translation updates 2007-11-15 20:38:15 +00:00
Peter Eisentraut 46c099ce71 Consistent capitalization 2007-11-07 14:07:21 +00:00
Peter Eisentraut 8a8bcb447a Translation updates 2007-10-27 00:13:43 +00:00