summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
AgeCommit message (Collapse)Author
2006-04-19Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.Tom Lane
Per Martijn van Oosterhout.
2006-04-12Fix pg_restore -n option to do what the man page says it does. TheTom Lane
original coding only worked if one of the selTypes restriction options was also given. Per report from Nick Johnson.
2006-04-07Fix pg_dumpall to do something sane when a pre-8.1 installation hasTom Lane
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.
2006-03-30Fix bad SQL, per Stefan Kaltenbrunner.Andrew Dunstan
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-03-03Improve pg_dump and psql to use libpq's newer COPY support routines,Tom Lane
instead of the old deprecated ones. Volkan Yazici, with some editorializing by moi.
2006-03-02Fix up pg_dump to emit shell-type definitions at the proper time, toTom Lane
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.
2006-02-21Fix old pg_dump oversight: default values for domains really need to be dumpedTom Lane
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.
2006-02-14Repair --single-transaction patch so it handles blobs correctly.Tom Lane
Simon Riggs
2006-02-13IMHO, --single-transaction should wrap *all* the commands in BEGIN/COMMIT,Tom Lane
not just some of them.
2006-02-12Add MSVC support for utility commands and pg_dump.Bruce Momjian
Hiroshi Saito
2006-02-12As part of previous commit, add pg_restore option:Bruce Momjian
-1 or --single-transaction Simon Riggs
2006-02-12Add psql option:Bruce Momjian
-1 or --single-transaction Simon Riggs
2006-02-12I've created a new shared catalog table pg_shdescription to storeBruce Momjian
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
2006-02-09This fixes pg_dump so that when using the '-O' no owners option it doesBruce Momjian
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
2006-02-09Provide the libpq error message when PQputline or PQendcopy fails.Tom Lane
2006-02-05Fix pg_restore to properly discard COPY data when trying to continueTom Lane
after an error in a COPY statement. Formerly it thought the COPY data was SQL commands, and got quite confused. Stephen Frost
2006-01-21Add GRANT ON SEQUENCE syntax to support sequence-only permissions.Bruce Momjian
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.
2006-01-11Brace cleanup.Bruce Momjian
2006-01-09Fix pg_dump to add the required OPERATOR() decoration to schema-qualifiedTom Lane
operator names. This is needed when dumping operator definitions that have COMMUTATOR (or similar) links to operators in other schemas. Apparently Daniel Whitter is the first person ever to try this :-(
2006-01-06Use RELKIND_COMPOSITE_TYPE rather than hardcoded 'c'.Bruce Momjian
2005-12-09Allow installation into directories containing spaces in the name.Peter Eisentraut
2005-12-03Treat procedural languages as owned by the bootstrap superuser, ratherTom Lane
than owned by nobody. This results in cleaner display of language ACLs, since the backend's aclchk.c uses the same convention. AFAICS there is no practical difference but it's nice to avoid emitting SET SESSION AUTHORIZATION; also this will make it easier to transition pg_dump to some future version in which we may include an explicit ownership column in pg_language. Per gripe from David Begley.
2005-12-02Fix obsolete comment.Tom Lane
2005-11-22Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
2005-11-07Translation updates forward-port to HEAD.Alvaro Herrera
2005-11-04Translation updatesPeter Eisentraut
2005-10-29Translation updatesPeter Eisentraut
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-10-10Remove the DELETEs from pg_shadow and pg_group that pg_dumpall used toTom Lane
emit when given the --clean option, in favor of individual DROP ROLE commands. The old technique could not possibly work in 8.1, and was never a very good idea anyway IMHO. The DROP ROLE approach has the defect that the DROPs will fail for roles that own objects or have privileges, but perhaps we can improve that later.
2005-10-10Translation updatePeter Eisentraut
2005-09-28Improve messagesPeter Eisentraut
2005-09-24Suppress signed-vs-unsigned-char warnings.Tom Lane
2005-09-21Suppress database dump item when --table and/or --schema switch wasTom Lane
given, per gripe from Michael Fuhr.
2005-09-11Fix some corner-case bugs in _sendSQLLine's parsing of SQL commandsTom Lane
> found in a pg_dump archive. It had problems with dollar-quote tags broken across bufferload boundaries (this may explain bug report from Rod Taylor), also with dollar-quote literals of the form $a$a$..., and was also confused about the rules for backslash in double quoted identifiers (ie, they're not special). Also put in placeholder support for E'...' literals --- this will need more work later.
2005-09-11Avoid changing stdin/stdout to binary mode on Windows unless that isTom Lane
really the source or destination of the archive. I think this will resolve recent complaints that password prompting is broken in pg_restore on Windows. Note that password prompting and reading from stdin is an unworkable combination on Windows ... but that was true anyway.
2005-09-05Implement a preliminary 'template' facility for procedural languages,Tom Lane
as per my recent proposal. For now the template data is hard-wired in proclang.c --- this should be replaced later by a new shared system catalog, but we don't want to force initdb during 8.1 beta. This change lets us cleanly load existing dump files even if they contain outright wrong information about a PL's support functions, such as a wrong path to the shared library or a missing validator function. Also, we can revert the recent kluges to make pg_dump dump PL support functions that are stored in pg_catalog. While at it, I removed the code in pg_regress that replaced $libdir with a hardcoded path for temporary installations. This is no longer needed given our support for relocatable installations.
2005-08-28dumpUserConfig failed (in a pretty harmless way, but failed nonetheless)Tom Lane
to cope with a group name when dumping from a pre-8.1 installation. Per report from Stefan Kaltenbrunner.
2005-08-23Add ALTER TABLE ENABLE/DISABLE TRIGGER commands. Change pg_dump toTom Lane
use these instead of its previous hack of changing pg_class.reltriggers. Documentation is lacking, will add that later. Patch by Satoshi Nagayasu, review and some extra work by Tom Lane.
2005-08-22Cause ALTER INDEX OWNER to generate a warning and do nothing, rather thanTom Lane
erroring out as it has done for the last couple weeks. Document that this form is now ignored because indexes can't usefully have different owners from their parent tables. Fix pg_dump to not generate ALTER OWNER commands for indexes.
2005-08-15Clean up recent patch for PL handler functions in pg_catalog: the patchTom Lane
caused PL languages and handlers to be dumped ALWAYS, even in the face of contrary --schema or --table switches. Adopt a slightly saner definition.
2005-08-15Change pg_dump to use pg_roles instead of pg_user on 8.1 and up,Tom Lane
so that it will correctly dump owners of objects owned by non-login roles.
2005-08-12Solve the problem of OID collisions by probing for duplicate OIDsTom Lane
whenever we generate a new OID. This prevents occasional duplicate-OID errors that can otherwise occur once the OID counter has wrapped around. Duplicate relfilenode values are also checked for when creating new physical files. Per my recent proposal.
2005-07-31Add per-user and per-database connection limit options.Tom Lane
This patch also includes preliminary update of pg_dumpall for roles. Petr Jelinek, with review by Bruce Momjian and Tom Lane.
2005-07-27Fix a few macro definitions to ensure that unary minus is enclosed inNeil Conway
parentheses. This avoids possible operator precedence problems, and is consistent with most of the macro definitions in the tree.
2005-07-27Avoid crashing pg_dump if we can't connect to the database server, andNeil Conway
no database has been explicitly specified. Per gripe from Omar Kilani.
2005-07-25Awhile back we replaced all uses of strcasecmp and strncasecmp withTom Lane
pg_strcasecmp and pg_strncasecmp ... but I see some of the former have crept back in. Eternal vigilance is the price of locale independence, apparently.
2005-07-18Avoid use of E'', and thereby creating an unnecessary version-dependency,Tom Lane
by using LIKE...ESCAPE instead. Per suggestion by andrew@supernews.
2005-07-10Add --encoding to pg_dump.Bruce Momjian
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-10This patch implements putting language handlers for the optional PLsBruce Momjian
into pg_catalog rather than public, and supports dumping languages whose handlers are found there. This will make it easier to drop the public schema if desired. Unlike the previous patch, the comments have been updated and I have reformatted some code to meet Alvarro's request to stick to 80 cols. (I actually aghree with this - it makes printing the code much nicer). I think I did the right thing w.r.t versions earlier than 7.3, but I have no real way of checking, so that should be checked by someone with more/older knowledge than me ;-) Andrew Dunstan