summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
Commit message (Collapse)AuthorAgeFilesLines
* pgindent run for 8.2.Bruce Momjian2006-10-0410-191/+210
|
* Remove separate strdup.h header file; it's redundant with port.h.Tom Lane2006-09-275-23/+5
|
* Fix bugs in plpgsql and ecpg caused by assuming that isspace() would onlyTom Lane2006-09-221-3/+3
| | | | | | | | | return true for exactly the characters treated as whitespace by their flex scanners. Per report from Victor Snezhko and subsequent investigation. Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally able to stop using it.
* Fix pg_dump for recent change removing separate RULE privilege.Tom Lane2006-09-081-2/+1
| | | | | I had thought this code could be left alone, but I was wrong: as-is it's failing to recognize when to use ALL for table privileges in 8.2.
* Fix all known problems with pg_dump's handling of serial sequencesTom Lane2006-08-212-113/+96
| | | | | | | | | | | | | | | | | | | | | by abandoning the idea that it should say SERIAL in the dump. Instead, dump serial sequences and column defaults just like regular ones. Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate the sequence-to-column dependency that was formerly created "behind the scenes" by SERIAL. This restores SERIAL to being truly "just a macro" consisting of component operations that can be stated explicitly in SQL. Furthermore, the new command allows sequence ownership to be reassigned, so that old mistakes can be cleaned up. Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there is no longer any very compelling argument why the sequence couldn't be dropped while keeping the column. (This forces initdb, to be sure the right kinds of dependencies are in there.) Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an owned sequence; you can now only do this indirectly by changing the owning table's owner or schema. This is an oversight in previous releases, but probably not worth back-patching.
* Suppress MSVC warnings about weak functions by usingBruce Momjian2006-08-091-3/+3
| | | | | | _CRT_SECURE_NO_DEPRECATE. Hiroshi Saito
* Fix bug in new pg_dump -T/-N handling that was dumping system schemas ifBruce Momjian2006-08-041-4/+12
| | | | these options were used before -n/-t.
* Fix logic to prevent pg_dump from dumping system schemas; bug introducedBruce Momjian2006-08-021-18/+27
| | | | | | in recent -t/-n/-T/-N patch. Small style cleanups.
* Fix bug I introduced while cleaning up pg_dump -t/-n patch.Bruce Momjian2006-08-011-4/+2
|
* Add pg_dump -X no-data-for-failed-tables option to suppress loading dataBruce Momjian2006-08-013-3/+26
| | | | | | if table creation failed (the table already exists). Martin Pitt
* Allow multiple -n (schema) and -t (table) pg_dump options, and add -TBruce Momjian2006-08-013-95/+251
| | | | | | | and -N options to exclude objects. Also support regular expressions for option object names. Greg Sabino Mullane
* Aggregate functions now support multiple input arguments. I also tookTom Lane2006-07-272-58/+60
| | | | | | | | the opportunity to treat COUNT(*) as a zero-argument aggregate instead of the old hack that equated it to COUNT(1); this is materially cleaner (no more weird ANYOID cases) and ought to be at least a tiny bit faster. Original patch by Sergey Koposov; review, documentation, simple regression tests, pg_dump and psql support by moi.
* Mark a few functions as static or NOT_USED.Bruce Momjian2006-07-184-12/+10
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-1411-36/+11
|
* Alphabetically order reference to include files, "N" - "S".Bruce Momjian2006-07-111-3/+3
|
* Allow each C include file to compile on its own by including any neededBruce Momjian2006-07-113-26/+34
| | | | header files.
* WIN32 fixes:Bruce Momjian2006-07-061-2/+10
| | | | | | | | | I take out patch for this as a promise. This is client-build support of MS-VC6+. Fix for different getaddrinfo structure ordering on Win32 for IPv6. Hiroshi Saito
* Add FILLFACTOR to CREATE INDEX.Bruce Momjian2006-07-022-15/+95
| | | | ITAGAKI Takahiro
* Fix for recent Win32 pg_dump tar temp file patch.Bruce Momjian2006-06-271-2/+3
| | | | Hiroshi Saito
* On Win32, use loop to create pg_dump temporary tar file in the currentBruce Momjian2006-06-271-1/+29
| | | | | | directory, not in device root, for permission reasons. Backpatch to 8.1.X.
* Document issues with non-default tablespaces and pg_dumpall restores.Bruce Momjian2006-06-161-2/+10
| | | | Backpatch documentation addition to 8.1.X.
* Repair remarkably-inefficient query for dumping large object comments: itTom Lane2006-06-091-3/+3
| | | | | | was invoking obj_description() for each large object chunk, instead of once per large object. This code is new as of 8.1, which may explain why the problem hadn't been noticed already.
* Prepare code to be built by MSVC:Bruce Momjian2006-06-077-23/+7
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Fix up hack to suppress escape_string_warning so that it actually worksTom Lane2006-06-011-1/+16
| | | | | | and there's only one place that's a kluge, ie, appendStringLiteralConn. Note that pg_dump itself doesn't use appendStringLiteralConn, so its behavior is not affected; only the other utility programs care.
* Escape processing patch:Bruce Momjian2006-05-311-1/+3
| | | | | | | | | | o turns off escape_string_warning in pg_dumpall.c o optionally use E'' for \password (undocumented option?) o honor standard_conforming-strings for \copy (but not support literal E'' strings) o optionally use E'' for \d commands o turn off escape_string_warning for createdb, createuser, droplang
* Fix up pg_dump to do string escaping fully correctly for client encodingTom Lane2006-05-287-203/+280
| | | | | | | | | and standard_conforming_strings; likewise for the other client programs that need it. As per previous discussion, a pg_dump dump now conforms to the standard_conforming_strings setting of the source database. We don't use E'' syntax in the dump, thereby improving portability of the SQL. I added a SET escape_strings_warning = off command to keep the dumps from getting a lot of back-chatter from that.
* Don't call PQclear until the struct is really no longer going to be used.Alvaro Herrera2006-05-281-4/+3
| | | | | | | Per Coverity bug #304. Thanks to Martijn van Oosterhout for reporting it. Zero out the pointer fields of PGresult so that these mistakes are more easily catched, per discussion.
* Use E'' strings internally only when standard_conforming_strings =Bruce Momjian2006-05-265-54/+119
| | | | | | | | | 'off'. This allows pg_dump output with standard_conforming_strings = 'on' to generate proper strings that can be loaded into other databases without the backslash doubling we typically do. I have added the dumping of the standard_conforming_strings value to pg_dump. I also added standard backslash handling for plpgsql.
* Fix pg_restore to process BLOB COMMENT entries correctly; they aren'tTom Lane2006-05-241-3/+4
| | | | | really tables and shouldn't get DISABLE TRIGGER processing. Per bug #2452 from Robert Treat.
* Add strerror to pg_dump error messages where missing.Peter Eisentraut2006-05-226-42/+51
|
* Code review for GRANT CONNECT patch. Spell the privilege as CONNECT notTom Lane2006-04-301-1/+2
| | | | | CONNECTION, fix a number of places that were missed (eg pg_dump support), avoid executing an extra search of pg_database during startup.
* Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.Tom Lane2006-04-191-2/+2
| | | | Per Martijn van Oosterhout.
* Fix pg_restore -n option to do what the man page says it does. TheTom Lane2006-04-122-12/+12
| | | | | original coding only worked if one of the selTypes restriction options was also given. Per report from Nick Johnson.
* Fix pg_dumpall to do something sane when a pre-8.1 installation hasTom Lane2006-04-071-37/+55
| | | | | | identically named user and group: we merge these into a single entity with LOGIN permission. Also, add ORDER BY commands to ensure consistent dump ordering, for ease of comparing outputs from different installations.
* Fix bad SQL, per Stefan Kaltenbrunner.Andrew Dunstan2006-03-301-4/+4
|
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-058-16/+16
|
* Improve pg_dump and psql to use libpq's newer COPY support routines,Tom Lane2006-03-032-42/+36
| | | | | instead of the old deprecated ones. Volkan Yazici, with some editorializing by moi.
* Fix up pg_dump to emit shell-type definitions at the proper time, toTom Lane2006-03-024-118/+278
| | | | | | | | | | make use of the recently added ability to create a shell type explicitly. I also put in place some infrastructure to allow dump/no dump decisions to be made separately for each database object, rather than the former hardwired 'dump if in a dumpable schema' policy. This was needed anyway for shell types so now seemed a convenient time to do it. The flexibility isn't exposed to the user yet, but is ready for future extensions.
* Fix old pg_dump oversight: default values for domains really need to be dumpedTom Lane2006-02-211-24/+66
| | | | | | | | | | | | by decompiling the typdefaultbin expression, not just printing the typdefault text which may be out-of-date or assume the wrong schema search path. (It's the same hazard as for adbin vs adsrc in column defaults.) The catalogs.sgml spec for pg_type implies that the correct procedure is to look to typdefaultbin first and consider typdefault only if typdefaultbin is NULL. I made dumping of both domains and base types do that, even though in the current backend code typdefaultbin is always correct for domains and typdefault for base types --- might as well try to future-proof it a little. Per bug report from Alexander Galler.
* Repair --single-transaction patch so it handles blobs correctly.Tom Lane2006-02-141-11/+27
| | | | Simon Riggs
* IMHO, --single-transaction should wrap *all* the commands in BEGIN/COMMIT,Tom Lane2006-02-131-5/+5
| | | | not just some of them.
* Add MSVC support for utility commands and pg_dump.Bruce Momjian2006-02-128-7/+213
| | | | Hiroshi Saito
* As part of previous commit, add pg_restore option:Bruce Momjian2006-02-121-2/+1
| | | | | | -1 or --single-transaction Simon Riggs
* Add psql option:Bruce Momjian2006-02-123-9/+25
| | | | | | -1 or --single-transaction Simon Riggs
* I've created a new shared catalog table pg_shdescription to storeBruce Momjian2006-02-122-11/+76
| | | | | | | | | | | | | | | | | | comments on cluster global objects like databases, tablespaces, and roles. It touches a lot of places, but not much in the way of big changes. The only design decision I made was to duplicate the query and manipulation functions rather than to try and have them handle both shared and local comments. I believe this is simpler for the code and not an issue for callers because they know what type of object they are dealing with. This has resulted in a shobj_description function analagous to obj_description and backend functions [Create/Delete]SharedComments mirroring the existing [Create/Delete]Comments functions. pg_shdescription.h goes into src/include/catalog/ Kris Jurka
* This fixes pg_dump so that when using the '-O' no owners option it doesBruce Momjian2006-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | not print the owner name in the object comment. eg: -- -- Name: actor; Type: TABLE; Schema: public; Owner: chriskl; Tablespace: -- Becomes: -- -- Name: actor; Type: TABLE; Schema: public; Owner: -; Tablespace: -- This makes it far easier to do 'user independent' dumps. Especially for distribution to third parties. Christopher Kings-Lynne
* Provide the libpq error message when PQputline or PQendcopy fails.Tom Lane2006-02-091-3/+5
|
* Fix pg_restore to properly discard COPY data when trying to continueTom Lane2006-02-053-14/+30
| | | | | | | after an error in a COPY statement. Formerly it thought the COPY data was SQL commands, and got quite confused. Stephen Frost
* Add GRANT ON SEQUENCE syntax to support sequence-only permissions.Bruce Momjian2006-01-213-24/+33
| | | | | | | | | | | | | Continue to support GRANT ON [TABLE] for sequences for backward compatibility; issue warning for invalid sequence permissions. [Backward compatibility warning message.] Add USAGE permission for sequences that allows only currval() and nextval(), not setval(). Mention object name in grant/revoke warnings because of possible multi-object operations.
* Brace cleanup.Bruce Momjian2006-01-111-3/+1
|