Commit Graph

249 Commits

Author SHA1 Message Date
Tom Lane 9ca89b4f8c Another place that needs schema qualification. 2002-05-29 01:49:57 +00:00
Tom Lane 49bf04ba8c Fix some more not-schema-aware queries in pg_dump. Also fix some places
that would do the wrong thing with BLOB OIDs exceeding 2G.
2002-05-29 01:38:56 +00:00
Tom Lane 36a1e732a6 Rework pg_dump namespace search criteria so that dumping of user objects
having names conflicting with system objects will work --- the search
path is now user-schema, pg_catalog rather than implicitly the other way
around.  Note this requires being careful to explicitly qualify references
to system names whenever pg_catalog is not first in the search path.
Also, add support for dumping ACLs of schemas.
2002-05-28 22:26:57 +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
Tom Lane 340b66cc70 Cause fmtId to always use its internal buffer for the returned value,
in hopes of making erroneous usage more apparent.  Per discussion 15-Apr.
2002-05-06 17:34:45 +00:00
Bruce Momjian 8be68479dc Remove compile warnings for lo dump by casting to char *. 2002-04-24 14:03:22 +00:00
Bruce Momjian e975123454 Speed improvement for large object restore.
Mario Weilguni
2002-04-24 02:21:04 +00:00
Tom Lane 15c30b6f9a Be more wary about mixed-case database names and user names. Get
the CREATE DATABASE command right in pg_dump -C case.
2002-02-11 00:18:20 +00:00
Tom Lane 6a67d9def0 Fix failure to reconnect as sequence's owner before issuing setval(). 2002-02-06 17:27:50 +00:00
Bruce Momjian 69f909ba10 You might want to run pg_indent on pg_backup_db.c however ...
tom lane
2002-01-18 19:17:05 +00:00
Tom Lane bb698c25c7 Fix pg_restore to handle the 'set max oid' entry correctly in archives
dumped by pg_dump -o.  Per bug report posted by Bruce; fix is from
Philip Warner, reviewed by Tom Lane.
2002-01-18 17:13:51 +00:00
Tom Lane 64af43a15f Add casts to suppress compiler warnings observed on Darwin platform
(surprised no one has reported these yet...)
2001-11-08 04:05:13 +00:00
Bruce Momjian ea08e6cd55 New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
2001-11-05 17:46:40 +00:00
Philip Warner 1ef62bb6fc - Fix compiler warning in pg_restore
- Fix handling of {data/schema}-only restores when using a full
  backup file; prior version was restoring schema in data-only
  restores. Added enum to make code easier to understand.
2001-11-04 04:05:36 +00:00
Bruce Momjian b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Tom Lane b662e321c5 Forbid the switch combination --clean --create, which is pointless
(why bother dropping individual objects in a just-created database?)
as well as dangerous (as the code stands, the drops will be issued in
the wrong database, namely the one you were originally connected to).
2001-10-23 21:26:44 +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 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 30c975e2cb One more round of translations and slight message tweaks 2001-08-19 22:17:03 +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 30ab5bd43d More message munging and localization for pg_dump, especially the
--verbose messages, which had not been considered so far.  Output to the
terminal should okay now; comments written into the dump are still English
only, which may or may not be the desirable thing.
2001-07-03 20:21:50 +00:00
Peter Eisentraut b559382134 National language support for pg_dump and pg_restore. Combined with big
message clean up.
2001-06-27 21:21:37 +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
Philip Warner bb30d49a2a - Don't dump COMMENTs in data-only dumps
- Fix view dumping SQL for V7.0
 - Fix bug when getting view oid with long view names
 - Treat SEQUENCE SET TOC entries as data entries rather than schema
   entries.
 - Make allowance for data entries that did not have a data dumper
   routine (eg. SEQUENCE SET)
2001-05-12 01:03:59 +00:00
Philip Warner 8dc42a3aa2 - Fixed CONSTRAINT TRIGGER dump to record tgconstrelid properly
- pgsql v7.0 compatbility
2001-04-25 07:03:20 +00:00
Philip Warner 232d8fa3c4 - Get view OID based on rule OID not base table OID
- Fix crash due to null string pointer in some tar files with some libs
2001-04-14 13:11:03 +00:00
Philip Warner 135040d511 Patch to put rudimentary dependency support into pg_dump. This addresses
the UDT/function order problem.

    - Rudimentary support for dependencies in archives.
      Uses dependencies to modify the OID used in sorting TOC
      entries. This will NOT handle multi-level dependencies,
      but will manage simple relationships like UDTs & their functions.

    - Treat OIDs with more respect (avoid using ints, use macros
      for conversion & comparison).
2001-04-01 05:42:51 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Philip Warner cfeccdf80a - Added CVS headers to files
- Avoid forcing table name to lower case in FixupBlobXrefs
 - Removed fmtId calls for all ArchiveEntry name fields. This fixes
   quoting problems in trigger enable/disable code for mixed case
   table names, and avoids commands like 'pg_restore -t '"TblA"'
2001-03-19 02:35:29 +00:00
Philip Warner 5c1b00450c Fixed but in _enableTriggersIfNecessary introduced by previous patches by me
which caused segfault in a data-only retore with BLOBs
2001-03-18 03:45:12 +00:00
Philip Warner ccca223b5c - Use subselect when enabling triggers,
- Use exact table names when enabling/disabling triggers
2001-03-13 13:18:44 +00:00
Philip Warner aa28eebf4c - Only disable triggers in DataOnly (or implied data-only) restores.
- Change -U option to -L to allow -U to specify username in future. (pg_restore)
2001-03-06 04:08:04 +00:00
Tom Lane 2b0f8ae009 Fix pg_dump crashes caused by bogus use of va_start/va_end (only seen
on some platforms, which is not too surprising considering how platform
specific these macros must be).
2001-02-23 22:52:32 +00:00
Bruce Momjian 51cd037746 The following patch is required for successful compilation on Irix.
Robert E. Bruccole
2001-01-29 00:11:41 +00:00
Philip Warner 7fcd675dc3 When dropping the schema, reconnect as owner of each object. 2001-01-27 12:35:29 +00:00
Philip Warner 06ef1ef2ec - Check ntuples == 1 for various SELECT statements.
- Fix handling of --tables=* (multiple tables never worked properly, AFAICT)
- strdup() the current user in DB routines
- Check results of IO routines more carefully.
- Check results of PQ routines more carefully.

Have not fixed index output yet.
2001-01-12 04:32:07 +00:00
Tom Lane 5cf81b3c06 Silence compiler warning. 2000-12-07 02:52:27 +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
Philip Warner 44954fae08 Added long-standing transaction when restoring BLOBS (uses commit every BLOB_BATCH_SIZE)
Prevent dumping of languages from template1.
2000-10-31 14:20:30 +00:00
Philip Warner 3cf6e94844 Use new datlastsysoid field in pg_database + some cleanups & fixes 2000-10-22 18:13:09 +00:00
Philip Warner 1b1dbb861d Fix bug in sequence dumping using new setval function 2000-10-13 00:43:31 +00:00
Philip Warner c2e302071f - Only disable triggers for the table being loaded
- disable triggers prior to BLOB load
- better query for loading blob xrefs
- Fixes to error handling code
2000-08-05 09:57:46 +00:00
Philip Warner 92bd532c1e - Added --create, --no-owner, --superuser, --no-reconnect (pg_dump & pg_restore)
- Added code to dump 'Create Schema' statement (pg_dump)
- Don't bother to disable/enable triggers if we don't have a superuser (pg_restore)
- Cleaned up code for reconnecting to database.
- Force a reconnect as superuser before enabling/disabling triggers.
- Added & Removed --throttle (pg_dump)
- Fixed minor bug in language dumping code: expbuffres were not being reset.
- Fixed version number initialization in _allocAH (pg_backup_archiver.c)
- Added second connection when restoring BLOBs to allow temp. table to survive
  (db reconnection causes temp tables to be lost).
2000-08-01 15:51:45 +00:00
Bruce Momjian 56c754a555 Some pedantic compile syntax errors to fix with the following patch
for today's snapshot

Andreas
2000-07-27 19:49:24 +00:00
Philip Warner bb080400f8 - no longer put ACLs at end of dump
- connect as appropriate user in pg_restore with db connection
- dump owner of rule in pg_dump
2000-07-24 06:24:26 +00:00
Philip Warner e8f69be054 - Support for BLOB output from pg_dump and input via pg_restore
- Support for direct DB connection in pg_restore
- Fixes in support for --insert flag
- pg_dump now outputs in modified OID order
- various other bug fixes
2000-07-21 11:40:08 +00:00
Jan Wieck 43f6ab8654 Please find attached a patch for the pg_dump directory which addresses:
- The problems Jan reported

- incompatibility with configure (now uses HAVE_LIBZ instead of HAVE_ZLIB)

- a problem in auto-detecting archive file format on piped archives

Philip Warner
2000-07-06 18:39:39 +00:00
Bruce Momjian 500b62b057 pg_dump patch from Philip Warner 2000-07-04 14:25:28 +00:00