Skip to content

Commit 005a121

Browse files
committed
Massive overhaul of pg_dump: make use of dependency information from
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.
1 parent a5ffa8f commit 005a121

14 files changed

+4427
-3301
lines changed

doc/src/sgml/ref/pg_restore.sgml

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.44 2003/11/29 19:51:39 pgsql Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.45 2003/12/06 03:00:10 tgl Exp $ -->
22

33
<refentry id="APP-PGRESTORE">
44
<refmeta>
@@ -227,35 +227,6 @@
227227
</listitem>
228228
</varlistentry>
229229

230-
<varlistentry>
231-
<term><option>-N</option></term>
232-
<term><option>--orig-order</option></term>
233-
<listitem>
234-
<para>
235-
Restore items in the order they were originally generated within
236-
<application>pg_dump</application>. This option has no known
237-
practical use, since <application>pg_dump</application> generates
238-
the items in an order convenient to it, which is unlikely to be a
239-
safe order for restoring them. (This is <emphasis>not</> the order
240-
in which the items are ultimately listed in the archive's table of
241-
contents.) See also <option>-r</>.
242-
</para>
243-
</listitem>
244-
</varlistentry>
245-
246-
<varlistentry>
247-
<term><option>-o</option></term>
248-
<term><option>--oid-order</option></term>
249-
<listitem>
250-
<para>
251-
Restore items in order by OID. This option is of limited usefulness,
252-
since OID is only an approximate indication of original creation
253-
order. This option overrides <option>-N</> if both are specified.
254-
See also <option>-r</>.
255-
</para>
256-
</listitem>
257-
</varlistentry>
258-
259230
<varlistentry>
260231
<term><option>-O</option></term>
261232
<term><option>--no-owner</option></term>
@@ -287,31 +258,6 @@
287258
</listitem>
288259
</varlistentry>
289260

290-
<varlistentry>
291-
<term><option>-r</option></term>
292-
<term><option>--rearrange</option></term>
293-
<listitem>
294-
<para>
295-
Rearrange items by object type (this occurs after the sorting
296-
specified by <option>-N</option> or <option>-o</option>, if
297-
given). The rearrangement is intended to give the best possible
298-
restore performance.
299-
</para>
300-
301-
<para>
302-
When none of <option>-N</option>, <option>-o</option>, and
303-
<option>-r</> appear, <application>pg_restore</application> restores
304-
items in the order they appear in the dump's table of contents,
305-
or in the order they appear in the <REPLACEABLE
306-
CLASS="PARAMETER">list-file</REPLACEABLE> if <option>-L</> is
307-
given. The combination of <option>-o</> and <option>-r</>
308-
duplicates the sorting done by <application>pg_dump</application>
309-
before creating the dump's table of contents,
310-
and so it is normally unnecessary to specify it.
311-
</para>
312-
</listitem>
313-
</varlistentry>
314-
315261
<varlistentry>
316262
<term><option>-R</option></term>
317263
<term><option>--no-reconnect</option></term>

src/bin/pg_dump/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.41 2003/11/29 19:52:04 pgsql Exp $
8+
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.42 2003/12/06 03:00:11 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -24,8 +24,8 @@ override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DBINDIR=\"$(bindir)\"
2424

2525
all: submake-libpq submake-libpgport submake-backend pg_dump pg_restore pg_dumpall
2626

27-
pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a
28-
$(CC) $(CFLAGS) pg_dump.o common.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
27+
pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(libpq_builddir)/libpq.a
28+
$(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
2929

3030
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
3131
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
@@ -50,4 +50,4 @@ uninstall:
5050
rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall$(X))
5151

5252
clean distclean maintainer-clean:
53-
rm -f pg_dump$(X) pg_restore$(X) pg_dumpall$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall.o
53+
rm -f pg_dump$(X) pg_restore$(X) pg_dumpall$(X) $(OBJS) pg_dump.o common.o pg_dump_sort.o pg_restore.o pg_dumpall.o

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy