Commit Graph

249 Commits

Author SHA1 Message Date
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
Peter Eisentraut 5094f99830 Document long names for format options (plain, tar, custom). They already
worked and someone asked about them, so we might as well document them.
2006-03-17 16:02:47 +00:00
Tom Lane b524cb36ac Make an editorial pass over the reference pages. 2005-11-01 21:09:51 +00:00
Tom Lane e5d6b91220 Add SET ROLE. This is a partial commit of Stephen Frost's recent patch;
I'm still working on the has_role function and information_schema changes.
2005-07-25 22:12:34 +00:00
Bruce Momjian d1cffe2f77 Add --encoding to pg_dump.
The Problem:  Occassionally a DBA needs to dump a database to a new
encoding.   In instances where the current encoding, (or lack of an
encoding, like SQL_ASCII) is poorly supported on the target  database
server, it can be useful to dump into a particular  encoding.  But,
currently the only way to set the encoding of  a pg_dump file is to
change  client_encoding in postgresql.conf and restart postmaster.
This is more  than a little awkward for production systems.

Magnus Hagander
2005-07-10 15:08:52 +00:00
Tom Lane 7a28de2052 pg_dump can now dump large objects even in plain-text output mode, by
using the recently added lo_create() function.  The restore logic in
pg_restore is greatly simplified as well, since there's no need anymore
to try to adjust database references to match a new set of blob OIDs.
2005-06-21 20:45:44 +00:00
Bruce Momjian ecd70d7526 Add reference to libpq environment variables for client applications. 2005-05-29 03:32:18 +00:00
Neil Conway 8a9cc26ee1 Fix minor thinko in pg_dump documentation of "-n" option. 2005-01-17 04:30:37 +00:00
Tom Lane cc093bc3ad More minor updates and copy-editing. 2005-01-04 03:58:16 +00:00
Tom Lane 9eff02f5ac Update obsolete comments about COPY vs INSERT options, per Uwe Schroeder. 2004-10-21 22:48:54 +00:00
Bruce Momjian dc0e76ca36 Change pg_dump to use ALTER OWNER commands instead of SET SESSION
AUTHORIZATION commands by default.  Move all GRANT and REVOKE commands
to the end of the dump to avoid restore failures in several situations.
Bring back --use-set-session-authorization option to get previous SET
behaviour

Christopher Kings-Lyne
2004-07-13 03:00:17 +00:00
Bruce Momjian afa035c204 Clarify schema meanings in pg_dump manual page by referring to object
definitions more frequently.
2004-07-10 15:51:28 +00:00
Bruce Momjian 9136613803 Add start/stop times for pg_dump/pg_dumpall when verbose output is used. 2004-06-07 20:35:57 +00:00
Bruce Momjian a1bd1d70d6 Update pg_dump -v comments to mention additional comments in dump file. 2004-05-31 13:37:52 +00:00
Tom Lane f862c42009 Use dollar-quoting for function bodies, unless disabled with
--disable-dollar-quoting.

Andrew Dunstan
2004-03-23 22:06:08 +00:00
Bruce Momjian 7ce9b7c0d8 This patch adds a new GUC var, "default_with_oids", which follows the
proposal for eventually deprecating OIDs on user tables that I posted
earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or
WITHOUT OIDS when dumping a table. The documentation has been updated.

Neil Conway
2003-12-01 22:08:02 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Peter Eisentraut 1d27de4cf4 Random copy-editing. 2003-11-04 09:55:39 +00:00
Tom Lane 6767cebc6f pg_dump/pg_restore now always use SET SESSION AUTHORIZATION, not \connect,
to control object ownership.  The use-set-session-authorization and
no-reconnect switches are obsolete (still accepted on the command line,
but they don't do anything).  This is a precursor to fixing handling
of CREATE SCHEMA, which will be a separate commit.
2003-09-23 22:48:53 +00:00
Bruce Momjian 2a5b6a7c9b This patch fixes a few missed GUC variables that were still upper case,
makes a few more small improvements to runtime.sgml, and makes some SGML
conventions more consistent.

Neil Conway
2003-09-11 21:42:20 +00:00
Peter Eisentraut c326d8f4f2 Add/edit index entries. 2003-08-31 17:32:24 +00:00
Tom Lane 8bfe93c5c8 pg_dump and pg_restore were stripping quotes and downcasing some but
not all SQL identifiers taken from command line arguments.  We decided
years ago that that was a bad idea: identifiers taken from the command
line should be treated as literally correct.  Remove the inconsistent
code that has crept in recently.  Also fix pg_dump so that the combination
of --schema and --table does what you'd expect, namely dump exactly one
table from exactly one schema.  Per gripe from Deepak Bhole of Red Hat.
2003-06-11 16:29:42 +00:00
Bruce Momjian 76fd678c06 Make pg_dump's concurency capability more prominent. 2003-04-17 15:34:37 +00:00
Peter Eisentraut 5e5c5cd31a Merge documentation into one book. (Build with "make html".) Replace
vague cross-references with real links.
2003-03-25 16:15:44 +00:00
Peter Eisentraut d258ba01ec Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
Bruce Momjian 526de7ffd1 Remove duplicate ANALYZE recommendation in pg_dump. 2003-03-18 17:05:01 +00:00
Bruce Momjian 29c18bca50 Add mention of ANALYZE after object restore. 2003-03-18 00:02:11 +00:00
Bruce Momjian 2bd63117c1 [ dumping schemas ]
> I don't care what you use for short options if all useful ones are taken.
> But the long option should be --schema.

Ok, fair enough: a revised patch is attached that uses the '-n' short
option and the '--schema' long option.

Neil Conway
2003-02-13 04:54:16 +00:00
Bruce Momjian be2b660ecd This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
2003-01-19 00:13:31 +00:00
Peter Eisentraut 939a59ffc6 Use our own version of getopt_long() if the OS doesn't have one. 2003-01-06 18:53:25 +00:00
Bruce Momjian da8149032a SGML improvements.
Neil Conway
2002-11-15 03:11:18 +00:00
Peter Eisentraut c086590380 Assorted reference page updates 2002-10-11 23:03:48 +00:00
Peter Eisentraut 40853dd445 Allow pg_dumpall to work with previous releases again. Don't pass the -c
option down to pg_dump, where it's useless, and clarify the meaning of -c
in the documentation.
2002-09-07 16:14:33 +00:00
Peter Eisentraut 38e444aae6 Make sure the pg_dump tar archiver can handle members larger than 2 GB, but
does not create members larger than allowed by the tar format.  Also, fix
the generation of the tar header to conform to POSIX.
2002-09-06 21:58:36 +00:00
Peter Eisentraut 7af5ea736f Reimplement pg_dumpall in C. Currently no change in functionality,
except that it's more robust, reconnects less often, and is NLS'ed.
2002-08-27 18:57:26 +00:00
Peter Eisentraut c828ec8820 Make pg_dump output more portable and more pleasing to look at.
The -n and -N options were removed.  Quoting is now smart enough to
supply quotes if and only if necessary.

Numerical types are now printed without quotes, except in cases of
special values such as NaN.

Boolean values printed as true and false.

Most string literals now do not escape whitespace characters (newlines,
etc.) for portability.

SET SESSION AUTHORIZATION argument is a string literal, to follow SQL.

Made commands output by pg_dump use consistent spacing and indentation.
2002-08-18 09:36:26 +00:00
Peter Eisentraut 029aa97f2d Make sure all clients have the same understanding of default user name
and database.  In particular, make script wrappers understand the
PGDATABASE environment variable.
2002-08-10 16:57:32 +00:00
Peter Eisentraut 06ad580f75 Structure reference pages consistently. Document that structure.
Add information about environment variables.
2002-07-28 15:22:21 +00:00
Tom Lane 9f0ae0c820 First pass at schema-fying pg_dump/pg_restore. Much to do still,
but the basic capability seems to work.
2002-05-10 22:36:27 +00:00
Thomas G. Lockhart c05f29e895 Augment the date/time examples in the User's Guide to reflect the newer
capabilities of specifying time zones as intervals per SQL9x.
Put refentrytitle contents on the same line as the tag.
 Otherwise, leading whitespace is propagated into the product, which
 (at least) messes up the ToC layout.
Remove (some) docinfo tags containing dates. Best to omit if the dates
 are not accurate; maybe use CVS dates instead or leave them out.
2002-04-21 19:02:39 +00:00
Peter Eisentraut b6ea172ace Spell checking and markup additions 2002-03-22 19:20:45 +00:00
Tom Lane 906254a53c pg_dump and pg_restore man pages need to mention that one should restore
into a virgin database, ie, one created from template0, if there are any
site-local additions in template1.
2002-02-11 00:14:10 +00:00
Thomas G. Lockhart 03a321d214 Use PostgreSQL consistantly throughout docs. Before, usage was split evenly
between Postgres and PostgreSQL.
2001-12-08 03:24:40 +00:00
Peter Eisentraut 651a639b8b proof-reading 2001-11-28 20:49:10 +00:00
Peter Eisentraut 17f0b55d15 Initial round of tweakage for man pages 2001-11-18 20:35:02 +00:00
Tom Lane 92e1b7431f Editorial work on descriptions of options. 2001-10-23 22:11:22 +00:00
Peter Eisentraut fdf07fe14f For consistency with the rest of PostgreSQL, rename BLOBs to large objects
in messages and documentation.
2001-09-21 21:58:30 +00:00
Peter Eisentraut 89a1ea4207 Put some kind of grammatical uniformity in the <refpurpose> lines. 2001-09-03 12:57:50 +00:00
Peter Eisentraut 627c0d4472 Add option to output SET SESSION AUTHORIZATION commands rather than
\connect, to avoid possible password prompts and such, at the drawback of
having to have superuser access.
2001-08-22 20:23:24 +00:00
Peter Eisentraut a0c449a0f8 Make pg_dump handle the new privileges.
Don't hardcode the maximum accepted server version, use PG_VERSION instead.
Install a notice processor so notices are handled like error messages.
Word smithing.
2001-08-12 19:02:39 +00:00
Peter Eisentraut a6677f0f9e Change "indices" to "indexes", per OED. 2001-05-17 21:50:18 +00:00
Peter Eisentraut f000ffd28e Add -U and -W options to pg_dump and friends to support non-interactive
specification of username (like in psql).  pg_dumpall now works with
password authentication.
2001-05-17 21:12:49 +00:00
Peter Eisentraut 406183fbed Tuning for docbook2man. 2001-03-17 16:27:31 +00:00
Peter Eisentraut 0dcd17702a Some editing, enhance markup, move description section before options list. 2001-03-06 18:55:57 +00:00
Philip Warner d3464631e3 - Minor correction to usage 2001-03-06 05:22:18 +00:00
Bruce Momjian 47065aec11 I'm attaching those diffs for the Reference Guide in a tar file, as
not all of them attached properly in the post I made a few minutes
ago. Please disregard those earlier files. The diffs in the tar file
replace them.

Pierce Tyler
2001-03-05 18:42:57 +00:00
Peter Eisentraut dccfd74935 Refine some things to create better looking man pages. 2000-12-25 23:15:27 +00:00
Tom Lane b7c3784417 Repair residual sillinesses from UUNET virtual host/socket path patch.
I hope all the dust has settled out now ...
2000-11-30 23:20:51 +00:00
Bruce Momjian 98e195d23b Make socket option specify just the directory, not the full path. 2000-11-22 01:41:14 +00:00
Philip Warner aec962d864 Update for new pg_dump with blobs etc 2000-11-21 15:39:09 +00:00
Bruce Momjian ab47254757 Add mention of hostname leading slash handling to all manual pages that use -h. 2000-11-13 23:57:20 +00:00
Bruce Momjian ebd61ac03f Remove -k unix socketpath option from client side, allow hostname with
leading slash to behave as a unix socket path.
2000-11-13 23:37:54 +00:00
Bruce Momjian 2150c2edf1 UUNET is looking into offering PostgreSQL as a part of a managed web
hosting product, on both shared and dedicated machines.  We currently
offer Oracle and MySQL, and it would be a nice middle-ground.
However, as shipped, PostgreSQL lacks the following features we need
that MySQL has:

1. The ability to listen only on a particular IP address.  Each
   hosting customer has their own IP address, on which all of their
   servers (http, ftp, real media, etc.) run.
2. The ability to place the Unix-domain socket in a mode 700 directory.
   This allows us to automatically create an empty database, with an
   empty DBA password, for new or upgrading customers without having
   to interactively set a DBA password and communicate it to (or from)
   the customer.  This in turn cuts down our install and upgrade times.
3. The ability to connect to the Unix-domain socket from within a
   change-rooted environment.  We run CGI programs chrooted to the
   user's home directory, which is another reason why we need to be
   able to specify where the Unix-domain socket is, instead of /tmp.
4. The ability to, if run as root, open a pid file in /var/run as
   root, and then setuid to the desired user.  (mysqld -u can almost
   do this; I had to patch it, too).

The patch below fixes problem 1-3.  I plan to address #4, also, but
haven't done so yet.  These diffs are big enough that they should give
the PG development team something to think about in the meantime :-)
Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get
out what I have, which works (for the problems it tackles), now.

With these changes, we can set up and run PostgreSQL with scripts the
same way we can with apache or proftpd or mysql.

In summary, this patch makes the following enhancements:

1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
   and command line options -k --unix-socket to the relevant programs.
2. Adds a -h option to postmaster to set the hostname or IP address to
   listen on instead of the default INADDR_ANY.
3. Extends some library interfaces to support the above.
4. Fixes a few memory leaks in PQconnectdb().

The default behavior is unchanged from stock 7.0.2; if you don't use
any of these new features, they don't change the operation.

David J. MacKenzie
2000-11-13 15:18:15 +00:00
Bruce Momjian b32685a999 Add proofreader's changes to docs.
Fix misspelling of disbursion to dispersion.
2000-10-05 19:48:34 +00:00
Bruce Momjian 2019e24dd8 spell cleanups 2000-07-22 04:45:10 +00:00
Bruce Momjian 1b7c13ea7b Change prompt % to $. 2000-07-21 00:24:37 +00:00
Bruce Momjian f947bbb3b2 Attached is are diffs for CREATE/ALTER table doc I've
forgotten in my mailbox (sorry). Haven't tried to  apply  and
    since I don't have working sgml stuff cannot check.

Jan
2000-04-11 14:43:54 +00:00
Tom Lane c84ba6638e Add a check to pg_dump to see whether backend is same version as pg_dump.
If not, abort by default.  Abort can be prevented by using -i or
--ignore-version switch.
2000-04-04 05:22:46 +00:00
Thomas G. Lockhart 39f69bc38f Start updating for the v7.0 release.
Use "generic functions" for math and other routines.
Use SQL92 "type 'literal'" syntax rather than Postgres "'literal'::type".
2000-03-27 17:14:43 +00:00
Peter Eisentraut bdb41ad0e7 Made abstime/reltime use int4 instead of time_t (TODO item)
Made type equivalency apply to aggregates (TODO item)
Fixed parsing bug in psql
Reverted some stupid options changes I made to pg_dump
2000-01-24 19:34:19 +00:00
Peter Eisentraut 28125ed5e0 Updated user interfaces on initdb, initlocation, pg_dump, ipcclean to a GNU-compliant'ish state.
Made ipcclean work on Linux.
2000-01-18 00:03:37 +00:00
Thomas G. Lockhart a27512e634 Complete merge of all old man page information.
ecpg reference page still needs formatting.
1999-07-22 15:09:15 +00:00
Thomas G. Lockhart a4ac2f458e Fix markup for docbook2man man page generation.
No big deal; fixed lots of other markup at the same time.
Bigest change: make sure there is no whitespace
 in front of <term> contents.
This will probably help the other output types too.
1999-07-06 17:16:42 +00:00
Thomas G. Lockhart 1ac838edba Minor updates for release.
Split reference pages for CREATE TABLE AS and SELECT INTO to allow psgml
 (the emacs parser) to handle parsing.
1999-06-14 07:37:05 +00:00
Bruce Momjian 615e77ede2 Make pg_dump dump ACL's by default, print warning on use of -z, and add
new -x option to skip acl dump.
1999-05-27 16:29:05 +00:00
Bruce Momjian 289a826dab Here is a new version of my patch for allowing pg_dump to DROP schema
elements prior to CREATEing new ones.  It is under control of the -c
command line option (with the default being status quo).

The DROP TRIGGER portion still needs implementation.  Anyone able to
help clarify what exactly the CREATE TRIGGER portion does so I can fix
this?

Again, I have tried this with tables/indexes/sequences, but do not
have other schema elements in my database.  As a result, I am not 100%
convinced that I got the syntax correct in all cases (but think I did,
nonetheless).  If anyone can check the other cases, I'd appreciate it.

Cheers,
Brook

[I added manual page and sgml additions for the new -c option.]
1999-01-21 22:53:37 +00:00
Thomas G. Lockhart a75f2d21a8 Clean up to ensure tag completion as required by the newest versions
of Norm's Modular Style Sheets and jade/docbook.
From Vince Vielhaber <vev@michvhf.com>.
1998-12-29 02:24:47 +00:00
Thomas G. Lockhart d85df9cae2 Add new "-N" flag to force double quotes around identifiers.
Fix missing mention of "-n" flag in synopsis.
1998-11-14 02:04:16 +00:00
Thomas G. Lockhart 3d83e28b2b Minor cleanup in markup, especially in the Output section. 1998-10-30 19:34:40 +00:00
Thomas G. Lockhart 5a61590e48 Add new "-n" flag to pg_dump.
Update UNLISTEN to not require double-quotes around the wildcard argument.
Clean up markup.
1998-10-10 17:13:47 +00:00
Bruce Momjian 252568dc11 Update pg_dump sgml and manuals to remove rule restriction. 1998-10-07 02:49:10 +00:00
Bruce Momjian 3abf496b8e > > There is a bug in check_foreign_key of refint.c which is bundled with
> > the standard distribution. It occurs when a trigger calling this
> > function recursively fires another trigger which calls the same
> > function. The calling check_foreign_key loses its plan informantion and
> > when it tries to use it the backend closes its channel. You can check it
> > with the sql script I am attaching below.
> > The solution to this is to do a find_plan again before executing it at
> > line 483 of refint.c.
> > Therefore two more lines should be added before line 483:

Anand Surelia
1998-10-06 03:12:59 +00:00
Thomas G. Lockhart 37d2f76ef7 Add new information for utility commands.
Haven't yet done cleardbdir, ipcclean, pg_passwd, and pg_upgrade.
Add reference info for the SQL VACUUM command (oops, forgot it earlier).
1998-10-05 02:54:45 +00:00