Commit Graph

2911 Commits

Author SHA1 Message Date
Peter Eisentraut dd7e54a17f Automatic view update rules
Bernd Helmle
2009-01-22 17:27:55 +00:00
Bruce Momjian 71928e7b9f Make psql \d and \dt consistent for system tables, i.e prevent \d from
showing system tables, make \dS pattern show system table details, and
have \dtS show system and _user_ tables, to be consistent with other \d*
commands.
2009-01-20 02:13:42 +00:00
Bruce Momjian 2384287f6d Document RELKIND_SPECIAL reference in psql, from <= 8.1.X. 2009-01-19 18:44:32 +00:00
Tom Lane 390081e3f5 Fix a pg_dump output ordering problem introduced in 8.3 by the addition of
array types for composite types.  Although pg_dump understood it wasn't
supposed to dump these array types as separate objects, it must include
them in the dependency ordering analysis, and it was improperly assigning them
the same relatively-high sort priority as regular types.  This resulted in
effectively moving composite types and tables up to that same high priority,
which broke any ordering requirements that weren't explicitly enforced by
dependencies.  In particular user-defined operator classes, which should come
out before tables, failed to do so.  Per report from Brendan Jurd.

In passing, also fix an ill-considered decision to give text search objects
the same sort priority as functions and operators --- the sort result looks
a lot nicer if different object types are kept separate.  The recent
foreign-data patch had copied that decision, making the sort ordering even
messier :-(
2009-01-18 20:44:45 +00:00
Peter Eisentraut cc02b5eff1 Remove period from primary error message. 2009-01-15 22:33:19 +00:00
Magnus Hagander 3a819b0780 Throw an error when using -C and -1 at the same time in pg_restore.
It's not possible to do CREATE DATABASE inside a transaction, so previously
we just got a server error instead.

Backpatch to 8.2, which is where the -1 feature appeared.
2009-01-13 11:44:56 +00:00
Bruce Momjian d00a3472cf Update MinGW so it handles fseeko() similar to Unix. 2009-01-07 03:39:33 +00:00
Bruce Momjian 7e518a3d01 Removeduplicate \dd psql help mention. 2009-01-07 03:05:26 +00:00
Bruce Momjian 3084a8aea3 Add spaces around psql \d* columns, per idea from Joshua Drake. 2009-01-07 00:05:28 +00:00
Bruce Momjian 17f601ecb2 Improve \z psql \? help display. 2009-01-06 23:09:56 +00:00
Bruce Momjian f5ed2ee533 Add documentation for new \d*S* patch, and clean up some of the docs.
Fix \do and trigger display for the patch too.
2009-01-06 23:01:57 +00:00
Bruce Momjian 9491c82f71 This makes all the \dX commands (most importantly to most: \df) work
like \dt does, in that it requires a \dXS to see system items.

Greg Sabino Mullane
2009-01-06 21:10:30 +00:00
Bruce Momjian 32695413f3 Make pg_dump and pg_dumpall --clean options match the SGML docs, for consistency. 2009-01-06 18:01:57 +00:00
Bruce Momjian 6715642000 Update pg_restore --help text to match the SGML documentation. 2009-01-06 17:18:11 +00:00
Tom Lane b0a6ad70a1 Add a --role option to pg_dump, pg_dumpall, and pg_restore. This allows
performing dumps and restores in accordance with a security policy that
forbids logging in directly as superuser, but instead specifies that you
should log into an admin account and then SET ROLE to the superuser.

In passing, clean up some ugly and mostly-broken code for quoting shell
arguments in pg_dumpall.

Benedek László, with some help from Tom Lane
2009-01-05 16:54:37 +00:00
Peter Eisentraut 26af72b46b Allow out-of-tree builds on mingw and cygwin
Author: Richard Evans <richard.evans@blueallegro.net>
2009-01-05 09:27:20 +00:00
Bruce Momjian 511db38ace Update copyright for 2009. 2009-01-01 17:24:05 +00:00
Tom Lane eb273743ed Fix another problem in SQL-MED \d displays: should have a clean failure
report if the command is attempted against an old server.
2008-12-31 18:33:03 +00:00
Tom Lane 6672daace1 Consistently use multi-line formatting for all ACL columns printed by psql's
various display commands, not only for \z.

In passing, fix some infelicities in the newly added \d commands for SQL-MED
catalogs.

Andreas Scherbaum and Tom Lane
2008-12-31 18:07:47 +00:00
Tom Lane 26ce4e85a1 Add a WINDOW attribute to CREATE FUNCTION, and teach pg_dump about it,
so that user-defined window functions are possible.  For the moment you'll
have to write them in C, for lack of any interface to the WindowObject API
in the available PLs, but it's better than no support at all.

There was some debate about the best syntax for this.  I ended up choosing
the "it's an attribute" position --- the other approach will inevitably be
more work, and the likely market for user-defined window functions is
probably too small to justify it.
2008-12-31 02:25:06 +00:00
Peter Eisentraut cae565e503 SQL/MED catalog manipulation facilities
This doesn't do any remote or external things yet, but it gives modules
like plproxy and dblink a standardized and future-proof system for
managing their connection information.

Martin Pihlak and Peter Eisentraut
2008-12-19 16:25:19 +00:00
Alvaro Herrera 1eec10a2de Have psql's \d+ print reloptions. Extracted from Euler Taveira de Oliveira's
reloptions patch for autovacuum and revised by me.

Note that there doesn't seem to be a way to display an index's reloptions.
2008-12-19 14:39:58 +00:00
Tom Lane 517ae4039e Code review for function default parameters patch. Fix numerous problems as
per recent discussions.  In passing this also fixes a couple of bugs in
the previous variadic-parameters patch.
2008-12-18 18:20:35 +00:00
Peter Eisentraut 218b4e8dd8 Append major version number and for libraries soname major version number
to the gettext domain name, to simplify parallel installations.

Also, rename set_text_domain() to pg_bindtextdomain(), because that is what
it does.
2008-12-11 07:34:09 +00:00
Peter Eisentraut b2971e2048 Set up ar, dlltool, dllwrap, and windres for cross-compiling if necessary.
Plus some makefile cleanup.

part of a patch from Richard Evans
2008-12-07 08:36:22 +00:00
Peter Eisentraut 455dffbb73 Default values for function arguments
Pavel Stehule, with some tweaks by Peter Eisentraut
2008-12-04 17:51:28 +00:00
Tom Lane 739259d62e Adjust the behavior of the PQExpBuffer code to make it have well-defined
results (ie, an empty "broken" buffer) if memory overrun occurs anywhere
along the way to filling the buffer.  The previous coding would just silently
discard portions of the intended buffer contents, as exhibited in trouble
report from Sam Mason.  Also, tweak psql's main loop to correctly detect
and report such overruns.  There's probably much more that should be done
in this line, but this is a start.
2008-11-26 00:26:23 +00:00
Peter Eisentraut a378555501 CLUSTER VERBOSE and corresponding clusterdb --verbose option
Jim Cox and Peter Eisentraut
2008-11-24 08:46:04 +00:00
Magnus Hagander 822f26069e Fix a few more format argument warnings. 2008-11-21 20:14:27 +00:00
Peter Eisentraut b09a1a2942 TABLE command 2008-11-20 14:04:46 +00:00
Peter Eisentraut 8b4da40487 Change this script to Perl 5 style. Add support for multiple refnames.
Sort the output by command name.  This previously only worked by source
file name, which doesn't always match the command name exactly.  And it
certainly won't work for multiple refnames.
2008-11-19 09:51:55 +00:00
Tom Lane 5c9c08d250 One more hack to see if we can get the cygwin machines building again.
This continues the saga of trying to get PGDLLIMPORT to work in pg_crc.h
in both backend and frontend environments.
2008-11-14 21:45:07 +00:00
Tom Lane 81e11f2d05 Actually, instead of whining about how type internal might not safely store
a pointer, why don't we just fix that.  Every known use of "internal" really
means a pointer anyway.
2008-11-14 02:09:52 +00:00
Magnus Hagander ccc9073f26 Make psql report "SSL connection (unknown cipher)" when libpq has set
up a SSL connection, but psql is compiled without support for it.

Not a really realistic use-case, but the patch also cuts down on
the number of places with #ifdef's...
2008-11-11 15:01:53 +00:00
Tom Lane a4917bef0e Add support for input and output of interval values formatted per ISO 8601;
specifically, we can input either the "format with designators" or the
"alternative format", and we can output the former when IntervalStyle is set
to iso_8601.

Ron Mayer
2008-11-11 02:42:33 +00:00
Alvaro Herrera 6462e7b81c Add a --locale switch to createdb, to ease the creation of databases with
different locales.  This is just syntactical sweetener over --lc-collate and
--lc-ctype.  Per discussion.

While at it, properly document --lc-ctype and --lc-collate in SGML docs,
which apparently were forgotten (or purposefully ommited?) when they were
created.
2008-11-10 16:25:41 +00:00
Tom Lane e4718f2c9e Replace pg_class.reltriggers with relhastriggers, which is just a boolean hint
("there might be triggers") rather than an exact count.  This is necessary
catalog infrastructure for the upcoming patch to reduce the strength of
locking needed for trigger addition/removal.  Split out and committed
separately for ease of reviewing/testing.

In passing, also get rid of the unused pg_class columns relukeys, relfkeys,
and relrefs, which haven't been maintained in many years and now have no
chance of ever being maintained (because of wishing to avoid locking).

Simon Riggs
2008-11-09 21:24:33 +00:00
Tom Lane df7641e25a Add a new GUC variable called "IntervalStyle" that decouples interval output
from DateStyle, and create a new interval style that produces output matching
the SQL standard (at least for interval values that fall within the standard's
restrictions).  IntervalStyle is also used to resolve the conflict between the
standard and traditional Postgres rules for interpreting negative interval
input.

Ron Mayer
2008-11-09 00:28:35 +00:00
Tom Lane 6517f377d6 Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at least
as much of it as lives in its default tablespace) to a new tablespace.

Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
2008-11-07 18:25:07 +00:00
Tom Lane cdc197cf31 Improve psql's \dC command to take a pattern parameter. Casts are shown
if their source or target types match the pattern (using the same definition
of "match" as \dT does).  Per recent discussion.
2008-11-06 15:18:36 +00:00
Tom Lane 13fc2e4df8 Fix two error-recovery bugs in describeOneTableDetails(), and make the code
to dump sequence values cope with sequences outside the search path and/or
having names that need quoting.  No back-patch needed because these are new
problems in 8.4.

Kris Jurka  (also a little bit of code beautification by tgl)
2008-11-03 19:08:56 +00:00
Heikki Linnakangas 092bc49653 Add support for user-defined I/O conversion casts. 2008-10-31 08:39:22 +00:00
Peter Eisentraut 34e37d58ed Message improvement
(also backported to 8.3)
2008-10-31 07:15:11 +00:00
Peter Eisentraut 06735e3256 Unicode escapes in strings and identifiers 2008-10-29 08:04:54 +00:00
Tom Lane 44d5be0e53 Implement SQL-standard WITH clauses, including WITH RECURSIVE.
There are some unimplemented aspects: recursive queries must use UNION ALL
(should allow UNION too), and we don't have SEARCH or CYCLE clauses.
These might or might not get done for 8.4, but even without them it's a
pretty useful feature.

There are also a couple of small loose ends and definitional quibbles,
which I'll send a memo about to pgsql-hackers shortly.  But let's land
the patch now so we can get on with other development.

Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane
2008-10-04 21:56:55 +00:00
Tom Lane d1af2694e5 Fix misspelled comment 2008-09-30 12:51:07 +00:00
Heikki Linnakangas 15c121b3ed Rewrite the FSM. Instead of relying on a fixed-size shared memory segment, the
free space information is stored in a dedicated FSM relation fork, with each
relation (except for hash indexes; they don't use FSM).

This eliminates the max_fsm_relations and max_fsm_pages GUC options; remove any
trace of them from the backend, initdb, and documentation.

Rewrite contrib/pg_freespacemap to match the new FSM implementation. Also
introduce a new variant of the get_raw_page(regclass, int4, int4) function in
contrib/pageinspect that let's you to return pages from any relation fork, and
a new fsm_page_contents() function to inspect the new FSM pages.
2008-09-30 10:52:14 +00:00
Heikki Linnakangas 83c3121403 Fix pg_dump bug in the database-level collation patch. "datcollate" and
"datctype" columns were misspelled. Per report from Chris Browne.
2008-09-24 19:33:15 +00:00
Magnus Hagander 660ad48d3b Silence compiler warning caused by recent collation patch. 2008-09-24 09:00:44 +00:00
Magnus Hagander 607b7166d8 Make sure pg_control is opened in binary mode, to deal
with situtations when the file contains an EOF maker
(0x1A) on Windows.

ITAGAKI Takahiro
2008-09-24 08:59:42 +00:00