aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_null.c
Commit message (Collapse)AuthorAge
* Reduce excessive dereferencing of function pointersPeter Eisentraut2017-09-07
| | | | | | | | | | | | It is equivalent in ANSI C to write (*funcptr) () and funcptr(). These two styles have been applied inconsistently. After discussion, we'll use the more verbose style for plain function pointer variables, to make it clear that it's a variable, and the shorter style when the function pointer is in a struct (s.func() or s->func()), because then it's clear that it's not a plain function name, and otherwise the excessive punctuation makes some of those invocations hard to read. Discussion: https://www.postgresql.org/message-id/f52c16db-14ed-757d-4b48-7ef360b1631d@2ndquadrant.com
* Create src/fe_utils/, and move stuff into there from pg_dump's dumputils.Tom Lane2016-03-24
| | | | | | | | | | | | | | | Per discussion, we want to create a static library and put the stuff into it that until now has been shared across src/bin/ directories by ad-hoc methods like symlinking a source file. This commit creates the library and populates it with a couple of files that contain the widely-useful portions of pg_dump's dumputils.c file. dumputils.c survives, because it has some stuff that didn't seem appropriate for fe_utils, but it's significantly smaller and is no longer referenced from any other directory. Follow-on patches will move more stuff into fe_utils. The Mkvcbuild.pm hacking here is just a best guess; we'll see how the buildfarm likes it.
* Access pg_dump's options structs through Archive struct, not directly.Tom Lane2016-01-13
| | | | | | | | | | | | | | | | | | Rather than passing around DumpOptions and RestoreOptions as separate arguments, add fields to struct Archive to carry pointers to these objects, and access them through those fields when needed. There already was a RestoreOptions pointer in Archive, though for no obvious reason it was part of the "private" struct rather than out where pg_dump.c could see it. Doing this allows reversion of quite a lot of parameter-addition changes made in commit 0eea8047bf, which is a good thing IMO because this will reduce the code delta between 9.4 and 9.5, probably easing a few future back-patch efforts. Moreover, the previous commit only added a DumpOptions argument to functions that had to have it at the time, which means we could anticipate still more code churn (and more back-patch hazard) as the requirement spread further. I'd hit exactly that problem in my upcoming patch to fix extension membership marking, which is what motivated me to do this.
* pg_dump: Reduce use of global variablesAlvaro Herrera2014-10-14
| | | | | | | | | | | | | | | Most pg_dump.c global variables, which were passed down individually to dumping routines, are now grouped as members of the new DumpOptions struct, which is used as a local variable and passed down into routines that need it. This helps future development efforts; in particular it is said to enable a mode in which a parallel pg_dump run can output multiple streams, and have them restored in parallel. Also take the opportunity to clean up the pg_dump header files somewhat, to avoid circularity. Author: Joachim Wieland, revised by Álvaro Herrera Reviewed by Peter Eisentraut
* Properly detect read and write errors in pg_dump/dumpall, and pg_restoreBruce Momjian2014-05-05
| | | | Previously some I/O errors were ignored.
* Move some pg_dump function around.Heikki Linnakangas2013-03-27
| | | | | | | | | | | | | | | | | Move functions used only by pg_dump and pg_restore from dumputils.c to a new file, pg_backup_utils.c. dumputils.c is linked into psql and some programs in bin/scripts, so it seems good to keep it slim. The parallel functionality is moved to parallel.c, as is exit_horribly, because the interesting code in exit_horribly is parallel-related. This refactoring gets rid of the on_exit_msg_func function pointer. It was problematic, because a modern gcc version with -Wmissing-format-attribute complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc version that Tom Lane's old HP-UX box has didn't accept that attribute on a function pointer, and gave an error. We still use a similar function pointer trick for getLocalPQBuffer() function, to use a thread-local version of that in parallel mode on Windows, but that dodges the problem because it doesn't take printf-like arguments.
* Create libpgcommon, and move pg_malloc et al to itAlvaro Herrera2013-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | libpgcommon is a new static library to allow sharing code among the various frontend programs and backend; this lets us eliminate duplicate implementations of common routines. We avoid libpgport, because that's intended as a place for porting issues; per discussion, it seems better to keep them separate. The first use case, and the only implemented by this patch, is pg_malloc and friends, which many frontend programs were already using. At the same time, we can use this to provide palloc emulation functions for the frontend; this way, some palloc-using files in the backend can also be used by the frontend cleanly. To do this, we change palloc() in the backend to be a function instead of a macro on top of MemoryContextAlloc(). This was previously believed to cause loss of performance, but this implementation has been tweaked by Tom and Andres so that on modern compilers it provides a slight improvement over the previous one. This lets us clean up some places that were already with localized hacks. Most of the pg_malloc/palloc changes in this patch were authored by Andres Freund. Zoltán Böszörményi also independently provided a form of that. libpgcommon infrastructure was authored by Álvaro.
* pg_dump: get rid of die_horriblyAlvaro Herrera2012-03-20
| | | | | | | | | | | | | | | | | | The old code was using exit_horribly or die_horribly other depending on whether it had an ArchiveHandle on which to close the connection or not; but there were places that were passing a NULL ArchiveHandle to die_horribly, and other places that used exit_horribly while having an AH available. So there wasn't all that much consistency. Improve the situation by keeping only one of the routines, and instead of having to pass the AH down from the caller, arrange for it to be present for an on_exit_nicely callback to operate on. Author: Joachim Wieland Some tweaks by me Per a suggestion from Robert Haas, in the ongoing "parallel pg_dump" saga.
* Move pg_dump memory routines into pg_dumpmem.c/h and restore common.cBruce Momjian2011-11-26
| | | | | with its original functions. The previous function migration would cause too many difficulties in back-patching.
* Modify pg_dump to use error-free memory allocation macros. This avoidsBruce Momjian2011-11-25
| | | | ignoring errors and call-site error checking.
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* Fix up pg_dump's treatment of large object ownership and ACLs. We now emitTom Lane2010-02-18
| | | | | | | | | | a separate archive entry for each BLOB, and use pg_dump's standard methods for dealing with its ownership, ACL if any, and comment if any. This means that switches like --no-owner and --no-privileges do what they're supposed to. Preliminary testing says that performance is still reasonable even with many blobs, though we'll have to see how that shakes out in the field. KaiGai Kohei, revised by me
* Additional fixes for large object access control.Itagaki Takahiro2009-12-14
| | | | | | Use pg_largeobject_metadata.oid instead of pg_largeobject.loid to enumerate existing large objects in pg_dump, pg_restore, and contrib modules.
* Fix pg_dump to do the right thing when escaping the contents of large objects.Tom Lane2009-08-04
| | | | | | | | | | | | | | | | The previous implementation got it right in most cases but failed in one: if you pg_dump into an archive with standard_conforming_strings enabled, then pg_restore to a script file (not directly to a database), the script will set standard_conforming_strings = on but then emit large object data as nonstandardly-escaped strings. At the moment the code is made to emit hex-format bytea strings when dumping to a script file. We might want to change to old-style escaping for backwards compatibility, but that would be slower and bulkier. If we do, it's just a matter of reimplementing appendByteaLiteral(). This has been broken for a long time, but given the lack of field complaints I'm not going to worry about back-patching.
* Make pg_dump/pg_restore --clean options drop large objects too.Tom Lane2009-07-21
| | | | | | In passing, make invocations of lo_xxx functions a bit more schema-safe. Itagaki Takahiro
* Provide for parallel restoration from a custom format archive. Each data andAndrew Dunstan2009-02-02
| | | | | | | | post-data step is run in a separate worker child (a thread on Windows, a child process elsewhere) up to the concurrent number specified by the new pg_restore command-line --multi-thread | -m switch. Andrew Dunstan, with some editing by Tom Lane.
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Prepare code to be built by MSVC:Bruce Momjian2006-06-07
| | | | | | | | | | 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
* Add MSVC support for utility commands and pg_dump.Bruce Momjian2006-02-12
| | | | Hiroshi Saito
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* pg_dump can now dump large objects even in plain-text output mode, byTom Lane2005-06-21
| | | | | | 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.
* Work around naming conflict between zlib and OpenSSL by tweaking inclusionTom Lane2003-12-08
| | | | order. Remove some unnecessary #includes (that duplicate c.h).
* Massive overhaul of pg_dump: make use of dependency information fromTom Lane2003-12-06
| | | | | | | pg_depend to determine a safe dump order. Defaults and check constraints can be emitted either as part of a table or domain definition, or separately if that's needed to break a dependency loop. Lots of old half-baked code for controlling dump order removed.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* pgindent run.Bruce Momjian2002-09-04
|
* Enable large file support.Peter Eisentraut2002-08-20
| | | | Use off_t and size_t in pg_dump to handle file offset arithmetic correctly.
* First pass at schema-fying pg_dump/pg_restore. Much to do still,Tom Lane2002-05-10
| | | | but the basic capability seems to work.
* Speed improvement for large object restore.Bruce Momjian2002-04-24
| | | | Mario Weilguni
* National language support for pg_dump and pg_restore. Combined with bigPeter Eisentraut2001-06-27
| | | | message clean up.
* Portability fix from Steve Nicolai.Tom Lane2001-03-24
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* - Added CVS headers to filesPhilip Warner2001-03-19
| | | | | | | - 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"'
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-10
| | | | | | | | | | | are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
* - Check ntuples == 1 for various SELECT statements.Philip Warner2001-01-12
| | | | | | | | | - 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.
* - Support for TAR outputPhilip Warner2000-07-21
- 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