Commit Graph

132 Commits

Author SHA1 Message Date
Peter Eisentraut 3439e40f9a Put options in some sensible order
For the --help output and reference pages of pg_dump, pg_dumpall,
pg_restore, put the options in some consistent, mostly alphabetical,
and consistent order, rather than newest option last or something like
that.
2011-05-25 21:53:26 +03:00
Peter Eisentraut c8e0c32119 Rename pg_dump --no-security-label to --no-security-labels
Other similar options also use the plural form.
2011-05-19 23:20:11 +03:00
Peter Eisentraut c13dc6402b Spell checking and markup refinement 2011-05-19 01:14:45 +03:00
Bruce Momjian afaed3add8 Document that pg_dump --clean might generate some harmless errors on restore. 2011-03-11 07:05:38 -05:00
Bruce Momjian 26174d5fd0 Reference doc "examples" section for pg_dump options that often need
complex quoting, e.g. -t and -n.
2011-03-10 19:40:23 -05:00
Heikki Linnakangas dafaa3efb7 Implement genuine serializable isolation level.
Until now, our Serializable mode has in fact been what's called Snapshot
Isolation, which allows some anomalies that could not occur in any
serialized ordering of the transactions. This patch fixes that using a
method called Serializable Snapshot Isolation, based on research papers by
Michael J. Cahill (see README-SSI for full references). In Serializable
Snapshot Isolation, transactions run like they do in Snapshot Isolation,
but a predicate lock manager observes the reads and writes performed and
aborts transactions if it detects that an anomaly might occur. This method
produces some false positives, ie. it sometimes aborts transactions even
though there is no anomaly.

To track reads we implement predicate locking, see storage/lmgr/predicate.c.
Whenever a tuple is read, a predicate lock is acquired on the tuple. Shared
memory is finite, so when a transaction takes many tuple-level locks on a
page, the locks are promoted to a single page-level lock, and further to a
single relation level lock if necessary. To lock key values with no matching
tuple, a sequential scan always takes a relation-level lock, and an index
scan acquires a page-level lock that covers the search key, whether or not
there are any matching keys at the moment.

A predicate lock doesn't conflict with any regular locks or with another
predicate locks in the normal sense. They're only used by the predicate lock
manager to detect the danger of anomalies. Only serializable transactions
participate in predicate locking, so there should be no extra overhead for
for other transactions.

Predicate locks can't be released at commit, but must be remembered until
all the transactions that overlapped with it have completed. That means that
we need to remember an unbounded amount of predicate locks, so we apply a
lossy but conservative method of tracking locks for committed transactions.
If we run short of shared memory, we overflow to a new "pg_serial" SLRU
pool.

We don't currently allow Serializable transactions in Hot Standby mode.
That would be hard, because even read-only transactions can cause anomalies
that wouldn't otherwise occur.

Serializable isolation mode now means the new fully serializable level.
Repeatable Read gives you the old Snapshot Isolation level that we have
always had.

Kevin Grittner and Dan Ports, reviewed by Jeff Davis, Heikki Linnakangas and
Anssi Kääriäinen
2011-02-08 00:09:08 +02:00
Bruce Momjian 03c25dd900 Mark all GUC variables with <varname> markup, rather than <literal>. 2011-02-02 18:06:38 -05:00
Heikki Linnakangas 7f508f1c6b Add 'directory' format to pg_dump. The new directory format is compatible
with the 'tar' format, in that untarring a tar format archive produces a
valid directory format archive.

Joachim Wieland and Heikki Linnakangas
2011-01-23 23:10:15 +02:00
Robert Haas 0d692a0dc9 Basic foreign table support.
Foreign tables are a core component of SQL/MED.  This commit does
not provide a working SQL/MED infrastructure, because foreign tables
cannot yet be queried.  Support for foreign table scans will need to
be added in a future patch.  However, this patch creates the necessary
system catalog structure, syntax support, and support for ancillary
operations such as COMMENT and SECURITY LABEL.

Shigeru Hanada, heavily revised by Robert Haas
2011-01-01 23:48:11 -05:00
Robert Haas 53dbc27c62 Support unlogged tables.
The contents of an unlogged table are WAL-logged; thus, they are not
available on standby servers and are truncated whenever the database
system enters recovery.  Indexes on unlogged tables are also unlogged.
Unlogged GiST indexes are not currently supported.
2010-12-29 06:48:53 -05:00
Peter Eisentraut 4b1742a192 Move the documentation of --no-security-label to a more sensible place
The order on the pg_dump/pg_dumpall man pages is not very strict, but
surely putting it under connection options was wrong.
2010-12-24 14:11:11 +02:00
Robert Haas a1b0035949 Document pg_dump(all) --no-security-label instead of --security-label.
The former is the option actually supported by these commands.
2010-12-23 23:22:40 -05:00
Robert Haas 4d355a8336 Add a SECURITY LABEL command.
This is intended as infrastructure to support integration with label-based
mandatory access control systems such as SE-Linux. Further changes (mostly
hooks) will be needed, but this is a big chunk of it.

KaiGai Kohei and Robert Haas
2010-09-27 20:55:27 -04:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Robert Haas ce68df468a Add options to force quoting of all identifiers.
I've added a quote_all_identifiers GUC which affects the behavior
of the backend, and a --quote-all-identifiers argument to pg_dump
and pg_dumpall which sets the GUC and also affects the quoting done
internally by those applications.

Design by Tom Lane; review by Alex Hunsaker; in response to bug #5488
filed by Hartmut Goebel.
2010-07-22 01:22:35 +00:00
Tom Lane 1bc8acca25 Clarify statements about tar archive format. 2010-02-23 17:28:09 +00:00
Bruce Momjian f8f0140d73 Document --version and --help options for all client applications (they
all support it).

Per report from Josh Kupershmidt
2010-02-19 14:36:45 +00:00
Bruce Momjian 2f6b4560af First pass over client applications documentation proofreading.
gabrielle
2010-02-19 03:50:03 +00:00
Alvaro Herrera 05f43650fc Document that autovacuum may run ANALYZE 2009-08-07 20:54:31 +00:00
Tom Lane 5698f6b925 Remove the -d and -D options of pg_dump and pg_dumpall. The functionality
is still available, but you must now write the long equivalent --inserts
or --column-inserts.  This change is made to eliminate confusion with the
use of -d to specify a database name in most other Postgres client programs.
Original patch by Greg Mullane, modified per subsequent discussion.
2009-03-22 16:44:26 +00:00
Peter Eisentraut b966b519f5 Provide some proper minimal documentation for the pg_dump(all) --binary-upgrade
option.  We don't want to commit to what it does, but hiding it will only
cause confusion.
2009-03-04 11:57:00 +00:00
Peter Eisentraut 9de59fd191 Add a -w/--no-password option that prevents all password prompts to all
programs that have a -W/--password option.

In passing, remove the ancient PSQL_ALWAYS_GET_PASSWORDS compile option.
2009-02-26 16:02:39 +00:00
Bruce Momjian 6883c54a62 Add pg_dump --binary-upgrade flag to be used by binary upgrade
utilities.

The new code allows transfer of dropped column information to the
upgraded server.
2009-02-17 15:41:50 +00:00
Bruce Momjian b79e374519 Update wording of how to prevent pg_dump from affecting statistics
collection.
2009-02-10 00:55:21 +00:00
Bruce Momjian 952fe78a05 Properly wrap new pg_dump doc text. 2009-02-07 15:25:51 +00:00
Bruce Momjian d54ae17b63 Document disabling the statistics collector pg_dump activity, and give a
bit more visibility to the PGOPTIONS environment variable supported by
libpq.

Bryce Nesbitt
2009-02-07 14:31:30 +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
Tom Lane 6741688b16 Fix pg_dump docs to acknowledge that you can use -Z with plain text output. Pointed out by Daniel Migowski. 2008-08-26 00:03:15 +00:00
Bruce Momjian 8875a16ee1 Mention that pg_dump does not dump ALTER DATABASE ... SET commands;
backpatch to 8.3.X. Also fix markup that had just one bullet.
2008-08-21 22:25:44 +00:00
Tom Lane 673a30fbb2 Add a pg_dump option --lock-wait-timeout to allow failing the dump if unable
to acquire shared table locks within a specified amount of time.

David Gould
2008-07-20 18:43:30 +00:00
Tom Lane c22ed3d523 Turn the -i/--ignore-version options of pg_dump and pg_dumpall into no-ops:
the server version check is now always enforced.  Relax the version check to
allow a server that is of pg_dump's own major version but a later minor
version; this is the only case that -i was at all safe to use in.

pg_restore already enforced only a very weak version check, so this is
really just a documentation change for it.

Per discussion.
2008-04-13 03:49:22 +00:00
Tom Lane 2d013c41a3 Fix bad spelling and worse grammar in recent doc commits. Propagate
pg_dump --ignore-version comments into pg_dumpall and pg_restore pages.
2008-03-26 16:34:47 +00:00
Bruce Momjian c22de3989b Strengthen warnings about using pg_dump's -i option. 2008-03-26 14:32:22 +00:00
Tom Lane 68528d37bb Support a --no-tablespaces option in pg_dump/pg_dumpall/pg_restore, so that
dumps can be loaded into databases without the same tablespaces that the
source had.  The option acts by suppressing all "SET default_tablespace"
commands, and also CREATE TABLESPACE commands in pg_dumpall's case.

Gavin Roy, with documentation and minor fixes by me.
2008-03-20 17:36:58 +00:00
Tom Lane 1ebff9ba81 Make documentation of -W options more accurate and uniform. 2007-12-11 19:57:32 +00:00
Tom Lane b581b85406 Fix seriously broken markup for libpq-envars cross-references. 2007-03-26 17:23:37 +00:00
Bruce Momjian 571df93cff More clearly document that most PostgreSQL utilities support libpq
environment variables.  Backpatch to 8.2.X.
2007-02-20 18:10:59 +00:00
Bruce Momjian b16dab66a7 Remove "History" sections for pg_dump and pg_restore. I don't think
anyone cares because the last history change was for PostgreSQL 7.1.
2007-02-20 15:01:17 +00:00
Neil Conway bd2c171414 This patch adds documentation for the long-version parameters --username
and --password for pg_dump, pg_dumpall and pg_restore, per complaint by
Michael Schmidt. Patch from Magnus Hagander.
2007-02-01 04:39:33 +00:00
Bruce Momjian e81c138e18 Update reference documentation on may/can/might:
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".
2007-01-31 23:26:05 +00:00
Tom Lane 7bbe35a540 Add an example showing how to cope with mixed-case names in pg_dump
switches.
2006-11-28 22:54:18 +00:00
Peter Eisentraut 0f763503ff Spellchecking and such 2006-10-23 18:10:32 +00:00
Tom Lane 24e9752863 Revise psql pattern-matching switches as per discussion. The rule is now
to process all inclusion switches then all exclusion switches, so that the
behavior is independent of switch ordering.
Use of -T does not cause non-table objects to be suppressed.  And
the patterns are now interpreted the same way psql's \d commands do it,
rather than as pure regex commands; this allows for example -t schema.tab
to do what it should have been doing all along.  Re-enable the --blobs
switch to do something useful, ie, add back blobs into a dump they were
otherwise suppressed from.
2006-10-09 23:36:59 +00:00
Peter Eisentraut 2b25e1169f The -X option in pg_dump was supposed to be a workaround for the lack of
portable long options.  But we have had portable long options for a long
time now, so this is obsolete.  Now people have added options which *only*
work with -X but not as regular long option, so I'm putting a stop to this:
-X is deprecated; it still works, but it has been removed from the
documentation, and please don't add more of them.
2006-10-07 20:59:05 +00:00
Bruce Momjian 32cebaecff Remove emacs info from footer of SGML files. 2006-09-16 00:30:20 +00:00
Bruce Momjian 8977b68a42 Allow multiple -n (schema) and -t (table) pg_dump options, and add -T
and -N options to exclude objects.  Also support regular expressions for
option object names.

Greg Sabino Mullane
2006-08-01 18:05:04 +00:00
Bruce Momjian fb4c180da0 Update pg_dump vesion wording. 2006-05-13 17:10:35 +00:00
Bruce Momjian 4b7b1df8a6 Mention version portability of pg_dump. 2006-05-13 16:19:54 +00:00
Bruce Momjian d9d2d91544 Recommend more clearly custom pg_dump format over tar, buy showing
custom format examples first.
2006-05-06 23:25:37 +00:00
Bruce Momjian 598dfee552 Document that pg_dump -d/-D prevents invalid data from canceling the
entire table load.
2006-04-15 18:11:16 +00:00