Commit ca1a20eb authored by Bruce Momjian's avatar Bruce Momjian

Fix for -da option of pg_dump.

parent cc7f0322
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.14 1996/11/10 01:35:39 bryanh Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.15 1996/11/17 04:56:01 momjian Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -84,18 +84,15 @@ usage(const char* progname) ...@@ -84,18 +84,15 @@ usage(const char* progname)
fprintf(stderr, "\t -H hostname \t\t server host name\n"); fprintf(stderr, "\t -H hostname \t\t server host name\n");
fprintf(stderr, "\t -p port \t\t server port number\n"); fprintf(stderr, "\t -p port \t\t server port number\n");
fprintf(stderr, "\t -v \t\t verbose\n"); fprintf(stderr, "\t -v \t\t verbose\n");
fprintf(stderr, "\t -d[a] \t\t dump data as proper insert strings\n"); fprintf(stderr, "\t -d \t\t dump data as proper insert strings\n");
fprintf(stderr, "\t \t\t (if 'a' then attribute names also)\n"); fprintf(stderr, "\t -D \t\t dump data as inserts with attribute names\n");
fprintf(stderr, "\t -S \t\t dump out only the schema, no data\n"); fprintf(stderr, "\t -S \t\t dump out only the schema, no data\n");
fprintf(stderr, "\t -a \t\t dump out only the data, no schema\n"); fprintf(stderr, "\t -a \t\t dump out only the data, no schema\n");
fprintf(stderr, "\t -t table \t\t dump for this table only\n"); fprintf(stderr, "\t -t table \t\t dump for this table only\n");
fprintf(stderr, "\t -o \t\t dump object id's (oids)\n"); fprintf(stderr, "\t -o \t\t dump object id's (oids)\n");
fprintf(stderr, "\n if dbname is not supplied, then the DATABASE environment name is used\n"); fprintf(stderr, "\nIf dbname is not supplied, then the DATABASE environment name is used.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "\tpg_dump dumps out postgres databases and produces a script file\n");
fprintf(stderr, "\tof SQL commands to regenerate the schema\n");
fprintf(stderr, "\tThe SQL output is designed for import into Postgres95\n");
exit(1); exit(1);
} }
...@@ -137,7 +134,7 @@ main(int argc, char** argv) ...@@ -137,7 +134,7 @@ main(int argc, char** argv)
progname = *argv; progname = *argv;
while ((c = getopt(argc, argv,"f:H:p:t:vSDd:ao")) != EOF) { while ((c = getopt(argc, argv,"f:H:p:t:vSDdDao")) != EOF) {
switch(c) { switch(c) {
case 'f': /* output file name */ case 'f': /* output file name */
filename = optarg; filename = optarg;
...@@ -156,7 +153,10 @@ main(int argc, char** argv) ...@@ -156,7 +153,10 @@ main(int argc, char** argv)
break; break;
case 'd': /* dump data as proper insert strings */ case 'd': /* dump data as proper insert strings */
dumpData = 1; dumpData = 1;
attrNames = strstr(optarg,"a") ? 1 : 0; break;
case 'D': /* dump data as proper insert strings with attr names */
dumpData = 1;
attrNames = 1;
break; break;
case 't': /* Dump data for this table only */ case 't': /* Dump data for this table only */
tablename = optarg; tablename = optarg;
......
.\" This is -*-nroff-*- .\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here.... .\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.1 1996/11/14 10:17:42 scrappy Exp $ .\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.2 1996/11/17 04:56:16 momjian Exp $
.TH PG_DUMP UNIX 1/20/96 Postgres95 Postgres95 .TH PG_DUMP UNIX 1/20/96 Postgres95 Postgres95
.SH NAME .SH NAME
pg_dump \(em dumps out a Postgres database into a script file pg_dump \(em dumps out a Postgres database into a script file
...@@ -21,7 +21,10 @@ port] ...@@ -21,7 +21,10 @@ port]
.BR "-v" .BR "-v"
] ]
[\c [\c
.BR "-d[a]" .BR "-d"
]
[\c
.BR "-D"
] ]
[\c [\c
.BR "-S" .BR "-S"
...@@ -75,11 +78,5 @@ the same as above. Partial index predicates are stored as plans) ...@@ -75,11 +78,5 @@ the same as above. Partial index predicates are stored as plans)
.BR "large objects" .BR "large objects"
pg_dump does not handle large objects. Large objects are ignored and pg_dump does not handle large objects. Large objects are ignored and
must be dealt with manually. must be dealt with manually.
.TP
.BR "oid preservation"
pg_dump does not preserve oid's while dumping. If you have
stored oid's explicitly in tables in user-defined attributes,
and are using them as keys, then the output scripts will not
regenerate your database correctly.
.SH "SEE ALSO" .SH "SEE ALSO"
copy(l) copy(l)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment