Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca1a20e

Browse files
committed
Fix for -da option of pg_dump.
1 parentcc7f032 commitca1a20e

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
*
2222
* IDENTIFICATION
23-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.14 1996/11/10 01:35:39 bryanh Exp $
23+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.15 1996/11/17 04:56:01 momjian Exp $
2424
*
2525
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2626
*
@@ -84,18 +84,15 @@ usage(const char* progname)
8484
fprintf(stderr,"\t -H hostname \t\t server host name\n");
8585
fprintf(stderr,"\t -p port \t\t server port number\n");
8686
fprintf(stderr,"\t -v \t\t verbose\n");
87-
fprintf(stderr,"\t -d[a] \t\t dump data as proper insert strings\n");
88-
fprintf(stderr,"\t\t\t(if 'a' thenattribute names also)\n");
87+
fprintf(stderr,"\t -d \t\t dump data as proper insert strings\n");
88+
fprintf(stderr,"\t-D \t\tdump data as inserts withattribute names\n");
8989
fprintf(stderr,"\t -S \t\t dump out only the schema, no data\n");
9090
fprintf(stderr,"\t -a \t\t dump out only the data, no schema\n");
9191
fprintf(stderr,"\t -t table \t\t dump for this table only\n");
9292
fprintf(stderr,"\t -o \t\t dump object id's (oids)\n");
93-
fprintf(stderr,"\n ifdbname is not supplied, then the DATABASE environment name is used\n");
93+
fprintf(stderr,"\nIfdbname is not supplied, then the DATABASE environment name is used.\n");
9494
fprintf(stderr,"\n");
9595

96-
fprintf(stderr,"\tpg_dump dumps out postgres databases and produces a script file\n");
97-
fprintf(stderr,"\tof SQL commands to regenerate the schema\n");
98-
fprintf(stderr,"\tThe SQL output is designed for import into Postgres95\n");
9996
exit(1);
10097
}
10198

@@ -137,7 +134,7 @@ main(int argc, char** argv)
137134

138135
progname=*argv;
139136

140-
while ((c=getopt(argc,argv,"f:H:p:t:vSDd:ao"))!=EOF) {
137+
while ((c=getopt(argc,argv,"f:H:p:t:vSDdDao"))!=EOF) {
141138
switch(c) {
142139
case'f':/* output file name */
143140
filename=optarg;
@@ -156,7 +153,10 @@ main(int argc, char** argv)
156153
break;
157154
case'd':/* dump data as proper insert strings */
158155
dumpData=1;
159-
attrNames=strstr(optarg,"a") ?1 :0;
156+
break;
157+
case'D':/* dump data as proper insert strings with attr names */
158+
dumpData=1;
159+
attrNames=1;
160160
break;
161161
case't':/* Dump data for this table only */
162162
tablename=optarg;

‎src/man/pg_dump.1

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.1 1996/11/14 10:17:42 scrappy Exp $
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.2 1996/11/17 04:56:16 momjian Exp $
44
.TH PG_DUMP UNIX 1/20/96 Postgres95 Postgres95
55
.SH NAME
66
pg_dump\(em dumps out a Postgres database into a script file
@@ -21,7 +21,10 @@ port]
2121
.BR"-v"
2222
]
2323
[\c
24-
.BR"-d[a]"
24+
.BR"-d"
25+
]
26+
[\c
27+
.BR"-D"
2528
]
2629
[\c
2730
.BR"-S"
@@ -75,11 +78,5 @@ the same as above. Partial index predicates are stored as plans)
7578
.BR"large objects"
7679
pg_dump does not handle large objects. Large objects are ignored and
7780
must be dealt with manually.
78-
.TP
79-
.BR"oid preservation"
80-
pg_dump does not preserve oid's while dumping. If you have
81-
stored oid's explicitly in tables in user-defined attributes,
82-
and are using them as keys, then the output scripts will not
83-
regenerate your database correctly.
8481
.SH "SEE ALSO"
8582
copy(l)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp