Commit Graph

1423 Commits

Author SHA1 Message Date
Peter Eisentraut 93d3bac564 Ignore UTF-8-encoded Unicode byte-order mark at the beginning of a file if
the client encoding is UTF-8.

a limited version of a patch proposed by Itagaki Takahiro
2009-11-21 23:59:12 +00:00
Tom Lane 2dee828cac Remove plpgsql's separate lexer (finally!), in favor of using the core lexer
directly.  This was a lot of trouble, but should be worth it in terms of
not having to keep the plpgsql lexer in step with core anymore.  In addition
the handling of keywords is significantly better-structured, allowing us to
de-reserve a number of words that plpgsql formerly treated as reserved.
2009-11-12 00:13:00 +00:00
Peter Eisentraut 60cd1f1829 In psql \du, separate the role attributes by comma instead of newline,
for an arguably more pleasant display.
2009-11-11 21:07:41 +00:00
Tom Lane 90bfe99963 Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
2009-11-10 23:12:13 +00:00
Peter Eisentraut 2fe1b4dd65 In psql, show view definition only with \d+, not with \d
The rationale is that view definitions tend to be long and obscure the
main information about the view.
2009-11-03 10:34:47 +00:00
Tom Lane be6899f139 Fix \df to re-allow regexp special characters in the function name pattern.
This has always worked, up until somebody's thinko here:
http://archives.postgresql.org/pgsql-committers/2009-04/msg00233.php
Per bug #5143 from Piotr Wolinski.
2009-10-28 18:09:44 +00:00
Peter Eisentraut ef8df75e67 Translations update for 8.5alpha2 2009-10-20 18:23:27 +00:00
Tom Lane 42ec8ad628 Add "\pset linestyle ascii/unicode" option to psql, allowing our traditional
ASCII-art style of table output to be upgraded to use Unicode box drawing
characters if desired.  By default, psql will use the Unicode characters
whenever client_encoding is UTF8.

The patch forces linestyle=ascii in pg_regress usage, ensuring we don't
break the regression tests in Unicode locales.

Roger Leigh
2009-10-13 21:04:01 +00:00
Alvaro Herrera 474f825574 Add the new psql command \drds to the psql docs, help and tab completion.
I also thank Bernd Helmle for the documentation help on the previous settings
patch, which I forgot on the commit message.
2009-10-08 16:34:01 +00:00
Alvaro Herrera 2eda8dfb52 Make it possibly to specify GUC params per user and per database.
Create a new catalog pg_db_role_setting where they are now stored, and better
encapsulate the code that deals with settings into its realm.  The old
datconfig and rolconfig columns are removed.

psql has gained a \drds command to display the settings.

Backwards compatibility warning: while the backwards-compatible system views
still have the config columns, they no longer completely represent the
configuration for a user or database.

Catalog version bumped.
2009-10-07 22:14:26 +00:00
Tom Lane 249724cb01 Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust
the privileges that will be applied to subsequently-created objects.

Such adjustments are always per owning role, and can be restricted to objects
created in particular schemas too.  A notable benefit is that users can
override the traditional default privilege settings, eg, the PUBLIC EXECUTE
privilege traditionally granted by default for functions.

Petr Jelinek
2009-10-05 19:24:49 +00:00
Tom Lane 799ac99201 Sync psql's scanner with recent changes in backend scanner's flex rules.
Marko Kreen, Tom Lane
2009-09-27 03:27:24 +00:00
Tom Lane 94f238cf1a Remove a couple hundred lines of ugly and tedious-to-maintain code by not
trying to parse COPY options exactly in psql's \copy support.  Instead,
just send the options as-is and let the backend sort it out.

Emmanuel Cecchet
2009-09-19 21:51:21 +00:00
Tom Lane 9dcc9c6b3b sql_help.c needs to be cvsignore'd. 2009-09-19 18:50:18 +00:00
Peter Eisentraut 20f7f019f9 Easier to translate psql help
Instead of requiring translators to translate the entire SQL command
synopses, change create_help.pl to only require them to translate the
placeholders, and paste those into the synopsis using a printf mechanism.
Make some small updates to the markup to make it easier to parse.

Note: This causes msgmerge of gettext 0.17 to segfault.  You will need
the patch from https://savannah.gnu.org/bugs/?27474 to make it work.
msgmerge usually only runs on babel.postgresql.org, however.
2009-09-18 05:00:42 +00:00
Tom Lane e97281c46c Write psql's ~/.psql_history file using history_truncate_file() and
append_history(), if libreadline is new enough to have those functions
(they seem to be present at least since 4.2; but libedit may not have them).
This gives significantly saner behavior when two or more sessions overlap in
their use of the history file; although having two sessions exit at just the
same time is still perilous to your history.  The behavior of \s remains
unchanged, ie, overwrite whatever was there.
Per bug #5052 from Marek Wójtowicz.
2009-09-13 22:18:22 +00:00
Peter Eisentraut 234c7ce9f2 Derived files that are shipped in the distribution used to be built in the
source directory even for out-of-tree builds.  They are now alsl built in
the build tree.  This should be more convenient for certain developers'
workflows, and shouldn't really break anything else.
2009-08-28 20:26:19 +00:00
Peter Eisentraut 9d182ef002 Update of install-sh, mkinstalldirs, and associated configury
Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
changes (which I simplified a bit).  install-sh is now able to install
multiple files in one run, so we could simplify our makefiles sometime.

install-sh also now has a -d option to create directories, so we don't need
mkinstalldirs anymore.

Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
instead of install-sh -d.  For consistency with the rest of the world,
the corresponding make variable has been renamed from $(mkinstalldirs) to
$(MKDIR_P).
2009-08-26 22:24:44 +00:00
Tom Lane 9b708f1f57 Fix inclusions of readline/editline header files so that we only attempt to
#include the version of history.h that is in the same directory as the
readline.h we are using.  This avoids problems in some scenarios where both
readline and editline are installed.  Report and patch by Zdenek Kotala.
2009-08-24 16:18:13 +00:00
Tom Lane e605fbcccd Try to defend against the possibility that libpq is still in COPY_IN state
when we reach the post-COPY "pump it dry" error recovery code that was added
2006-11-24.  Per a report from Neil Best, there is at least one code path
in which this occurs, leading to an infinite loop in code that's supposed
to be making it more robust not less so.  A reasonable response seems to be
to call PQputCopyEnd() again, so let's try that.

Back-patch to all versions that contain the cleanup loop.
2009-08-07 20:16:11 +00:00
Tom Lane 9072592946 Add ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCT
Robert Haas
2009-08-02 22:14:53 +00:00
Tom Lane 25d9bf2e3e Support deferrable uniqueness constraints.
The current implementation fires an AFTER ROW trigger for each tuple that
looks like it might be non-unique according to the index contents at the
time of insertion.  This works well as long as there aren't many conflicts,
but won't scale to massive unique-key reassignments.  Improving that case
is a TODO item.

Dean Rasheed
2009-07-29 20:56:21 +00:00
Tom Lane a07e5acebb Code review for FORCE QUOTE * patch: fix error checking to consider FORCE
QUOTE * as a variety of FORCE QUOTE, and update psql documentation to include
the option.  (The actual psql code doesn't seem to need any changes.)
2009-07-25 17:04:19 +00:00
Peter Eisentraut 5e22994127 Document \dg+ and \du+
The fact that \dg and \du take the + option was missing in the documentation.

backpatched to 8.4

Author: Andreas Wenk <a.wenk@netzmeister-st-pauli.de>
2009-07-24 19:35:44 +00:00
Tom Lane 888d3335b1 Remove unnecessary and version-sensitive dependence on the exact set of
column names to be found in a sequence.  Per gripe from Bruce.
2009-07-20 03:46:45 +00:00
Tom Lane e01d732db3 Just a little more schema-qualification ... 2009-07-07 21:45:05 +00:00
Peter Eisentraut b34f6ab804 psql backward compatibility fix
For servers older than 8.3, sort display of child tables by relname instead
of oid::regclass::text, because the cast from regclass to text did not work
back then.  The older display may be slightly worse when different schemas
are involved, but that should be rare enough.
2009-07-07 20:32:20 +00:00
Peter Eisentraut 987281274f Sort child tables by name instead of OID in \d+ display
This was an oversight in the recent patch.  Found by Tom Lane.
2009-07-07 19:05:57 +00:00
Tom Lane 788d8e5139 Code review for patch to show definition of index columns in \d on index.
Safely schema-qualify the pg_get_indexdef call, make the query a bit
prettier in -E mode, remove useless join to pg_index, make it more obvious
that the header[] array is not overrun.
2009-07-07 16:28:38 +00:00
Peter Eisentraut bf6570abef Show definition of index columns in \d on index
This adds a column called "Definition" to the output of psql \d on an
index, which shows the full expression behind the index column.  For indexes
on plain columns, this is redundant,  but for expression indexes, this
reveals the real expression.

Author: Khee Chin <kheechin@gmail.com>
2009-07-06 17:01:42 +00:00
Peter Eisentraut e2b42aef53 Have \d show child tables that inherit from the specified parent
As per discussion, \d shows only the number of child tables, because that
could be hundreds, when used for partitioning.  \d+ shows the actual list.

Author: Damien Clochard <damien@dalibo.info>
2009-07-03 18:56:50 +00:00
Peter Eisentraut a6667d96c5 Translation updates for 8.4 release.
File that are translated less than 80% have been removed, as per new
translation team policy.
2009-06-26 19:33:52 +00:00
Tom Lane 8d355d7bbf Fix the makefiles to fail cleanly if Perl is needed but not present. This
used to work as intended, but got broken some time ago (a quoted empty string
is not an empty string), and got broken some more by the changes to generate
ecpg's preproc.y automatically.  Given all the unprotected uses of $(PERL)
elsewhere, it seems best to make use of the $(missing) script rather than
trying to ensure each such use is protected individually.  Also fix various
bits of documentation that omitted to mention Perl as a requirement for
building from a CVS pull.  Per a complaint from Robert Haas.
2009-06-23 03:46:00 +00:00
Peter Eisentraut 215ea9b455 Tweak the display of incoming foreign-key constraints in \d, per discussion
on hackers.  Also, take that string out of the translation roster, since
it's now entirely pseudo-SQL.
2009-06-13 13:43:34 +00:00
Tom Lane bfd06a713b Fix several places where a function was declared static and then defined
without static.  Per testing with a compiler that complains about this.
2009-06-12 16:17:29 +00:00
Bruce Momjian d747140279 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
2009-06-11 14:49:15 +00:00
Peter Eisentraut 0b7b908882 Translation updates 2009-06-10 23:42:44 +00:00
Peter Eisentraut 5e29862aa2 Clarify error message 2009-06-10 21:51:56 +00:00
Tom Lane 0d5478196a Trivial code style cleanup around a couple of ngettext calls. 2009-06-04 19:17:39 +00:00
Peter Eisentraut 84f2f5c023 Fix to use the same format specifiers in both branches of a ngettext().
Zdenek Kotala
2009-05-27 20:47:55 +00:00
Alvaro Herrera f97017068f Translation updates 2009-05-14 21:41:53 +00:00
Tom Lane 9f4e9bfa9b Code review for \df rewrite: fix assorted bugs, make type and
volatility columns localizable.
2009-05-05 02:29:06 +00:00
Heikki Linnakangas 0e19884838 Fix the query used for \d against 8.2 and 8.3 servers. 2009-05-04 17:31:35 +00:00
Tom Lane 1d3a1613c5 Remove Windows-specific definition of S_ISDIR(). This should not be here;
if there are any Windows configurations where port/win32.h fails to
provide the macro, it should be fixed in the latter file not here.
2009-04-26 15:31:50 +00:00
Bruce Momjian 73b44dca38 Use brackets in psql \df \? help. 2009-04-22 14:58:48 +00:00
Bruce Momjian 0669785ba8 Improve psql \df error handling.
David Fetter
2009-04-21 17:28:01 +00:00
Bruce Momjian 301f800895 Merge psql \df options into a single \? line, and update docs. 2009-04-21 17:23:05 +00:00
Bruce Momjian aeb3c2fce4 Add agg/normal/trigger/window flags for psql \df and in \df output.
David Fetter
2009-04-21 15:49:06 +00:00
Alvaro Herrera 088ac581d4 Make string more alike other similar messages. 2009-04-11 18:38:54 +00:00
Peter Eisentraut fbaeae3fc5 Message fix
(I guess this was a cruise replace mistake.)
2009-04-11 14:11:45 +00:00