Commit dfc1a6a8 authored by Bruce Momjian's avatar Bruce Momjian

Document pg_dump -z, clean up option list. Fix problem with libpq handling of...

Document pg_dump -z, clean up option list.  Fix problem with libpq handling of field names uppercase code.
parent df823bc4
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.39 1997/11/28 17:26:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.40 1997/12/01 21:00:35 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation * heap_create() - Create an uncataloged heap relation
...@@ -35,26 +35,28 @@ ...@@ -35,26 +35,28 @@
#include <catalog/heap.h> #include <catalog/heap.h>
#include <catalog/index.h> #include <catalog/index.h>
#include <catalog/indexing.h> #include <catalog/indexing.h>
#include <catalog/pg_ipl.h> #include <catalog/pg_attrdef.h>
#include <catalog/pg_index.h>
#include <catalog/pg_inherits.h> #include <catalog/pg_inherits.h>
#include <catalog/pg_ipl.h>
#include <catalog/pg_proc.h> #include <catalog/pg_proc.h>
#include <catalog/pg_index.h>
#include <catalog/pg_type.h>
#include <catalog/pg_attrdef.h>
#include <catalog/pg_relcheck.h> #include <catalog/pg_relcheck.h>
#include <catalog/pg_type.h>
#include <commands/trigger.h> #include <commands/trigger.h>
#include <nodes/plannodes.h>
#include <optimizer/tlist.h>
#include <parser/parse_expr.h> #include <parser/parse_expr.h>
#include <parser/parse_node.h> #include <parser/parse_node.h>
#include <parser/parse_type.h> #include <parser/parse_type.h>
#include <rewrite/rewriteRemove.h>
#include <storage/bufmgr.h> #include <storage/bufmgr.h>
#include <storage/lmgr.h> #include <storage/lmgr.h>
#include <storage/smgr.h> #include <storage/smgr.h>
#include <rewrite/rewriteRemove.h> #include <tcop/tcopprot.h>
#include <utils/builtins.h> #include <utils/builtins.h>
#include <utils/mcxt.h> #include <utils/mcxt.h>
#include <utils/relcache.h> #include <utils/relcache.h>
#include <utils/tqual.h> #include <utils/tqual.h>
#include <nodes/plannodes.h>
#ifndef HAVE_MEMMOVE #ifndef HAVE_MEMMOVE
#include <regex/utils.h> #include <regex/utils.h>
#else #else
...@@ -1482,10 +1484,6 @@ DestroyTempRels(void) ...@@ -1482,10 +1484,6 @@ DestroyTempRels(void)
tempRels = NULL; tempRels = NULL;
} }
extern List *flatten_tlist(List *tlist);
extern List *
pg_plan(char *query_string, Oid *typev, int nargs,
QueryTreeList **queryListP, CommandDest dest);
static void static void
StoreAttrDefault(Relation rel, AttrDefault *attrdef) StoreAttrDefault(Relation rel, AttrDefault *attrdef)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.53 1997/11/21 18:11:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.54 1997/12/01 21:00:57 momjian Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -106,30 +106,28 @@ char g_comment_end[10]; ...@@ -106,30 +106,28 @@ char g_comment_end[10];
static void static void
usage(const char *progname) usage(const char *progname)
{ {
fprintf(stderr,
"%s - version 1.13.dhb.2\n\n", progname);
fprintf(stderr, fprintf(stderr,
"usage: %s [options] [dbname]\n", progname); "usage: %s [options] [dbname]\n", progname);
fprintf(stderr, fprintf(stderr,
"\t -f filename \t\t script output filename\n"); "\t -a \t\t dump out only the data, no schema\n");
fprintf(stderr, fprintf(stderr,
"\t -h hostname \t\t server host name\n"); "\t -d \t\t dump data as proper insert strings\n");
fprintf(stderr, fprintf(stderr,
"\t -p port \t\t server port number\n"); "\t -D \t\t dump data as inserts with attribute names\n");
fprintf(stderr, fprintf(stderr,
"\t -v \t\t verbose\n"); "\t -f filename \t\t script output filename\n");
fprintf(stderr, fprintf(stderr,
"\t -d \t\t dump data as proper insert strings\n"); "\t -h hostname \t\t server host name\n");
fprintf(stderr, fprintf(stderr,
"\t -D \t\t dump data as inserts with attribute names\n"); "\t -o \t\t dump object id's (oids)\n");
fprintf(stderr, fprintf(stderr,
"\t -S \t\t dump out only the schema, no data\n"); "\t -p port \t\t server port number\n");
fprintf(stderr, fprintf(stderr,
"\t -a \t\t dump out only the data, no schema\n"); "\t -s \t\t dump out only the schema, no data\n");
fprintf(stderr, fprintf(stderr,
"\t -t table \t\t dump for this table only\n"); "\t -t table \t\t dump for this table only\n");
fprintf(stderr, fprintf(stderr,
"\t -o \t\t dump object id's (oids)\n"); "\t -v \t\t verbose\n");
fprintf(stderr, fprintf(stderr,
"\t -z \t\t dump ACLs (grant/revoke)\n"); "\t -z \t\t dump ACLs (grant/revoke)\n");
fprintf(stderr, fprintf(stderr,
...@@ -479,41 +477,41 @@ main(int argc, char **argv) ...@@ -479,41 +477,41 @@ main(int argc, char **argv)
progname = *argv; progname = *argv;
while ((c = getopt(argc, argv, "f:h:p:t:vSDdDaoz")) != EOF) while ((c = getopt(argc, argv, "adDf:h:op:st:vz")) != EOF)
{ {
switch (c) switch (c)
{ {
case 'a': /* Dump data only */
dataOnly = 1;
break;
case 'd': /* dump data as proper insert strings */
dumpData = 1;
break;
case 'D': /* dump data as proper insert strings with
* attr names */
dumpData = 1;
attrNames = 1;
break;
case 'f': /* output file name */ case 'f': /* output file name */
filename = optarg; filename = optarg;
break; break;
case 'h': /* server host */ case 'h': /* server host */
pghost = optarg; pghost = optarg;
break; break;
case 'o': /* Dump oids */
oids = 1;
break;
case 'p': /* server port */ case 'p': /* server port */
pgport = optarg; pgport = optarg;
break; break;
case 'v': /* verbose */ case 's': /* dump schema only */
g_verbose = true;
break;
case 'S': /* dump schema only */
schemaOnly = 1; schemaOnly = 1;
break; break;
case 'd': /* dump data as proper insert strings */
dumpData = 1;
break;
case 'D': /* dump data as proper insert strings with
* attr names */
dumpData = 1;
attrNames = 1;
break;
case 't': /* Dump data for this table only */ case 't': /* Dump data for this table only */
tablename = optarg; tablename = optarg;
break; break;
case 'a': /* Dump data only */ case 'v': /* verbose */
dataOnly = 1; g_verbose = true;
break;
case 'o': /* Dump oids */
oids = 1;
break; break;
case 'z': /* Dump oids */ case 'z': /* Dump oids */
acls = 1; acls = 1;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.47 1997/11/17 16:42:39 thomas Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.48 1997/12/01 21:01:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -430,7 +430,7 @@ PQsetdb(const char *pghost, const char *pgport, const char *pgoptions, const cha ...@@ -430,7 +430,7 @@ PQsetdb(const char *pghost, const char *pgport, const char *pgoptions, const cha
*(conn->dbName + strlen(conn->dbName) - 1) = '\0'; *(conn->dbName + strlen(conn->dbName) - 1) = '\0';
} }
else else
for (i = 0; conn->dbName[i]; i++) for (i = strlen(conn->dbName[i]); i >= 0; i--)
if (isupper(conn->dbName[i])) if (isupper(conn->dbName[i]))
conn->dbName[i] = tolower(conn->dbName[i]); conn->dbName[i] = tolower(conn->dbName[i]);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.40 1997/11/10 05:10:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.41 1997/12/01 21:01:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1697,7 +1697,7 @@ PQfnumber(PGresult *res, const char *field_name) ...@@ -1697,7 +1697,7 @@ PQfnumber(PGresult *res, const char *field_name)
*(field_case + strlen(field_case) - 1) = '\0'; *(field_case + strlen(field_case) - 1) = '\0';
} }
else else
for (i = 0; field_case; i++) for (i = strlen(field_case[i]); i >= 0; i--)
if (isupper(field_case[i])) if (isupper(field_case[i]))
field_case[i] = tolower(field_case[i]); field_case[i] = tolower(field_case[i]);
......
.\" 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.7 1997/10/30 03:59:59 momjian Exp $ .\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.8 1997/12/01 21:01:24 momjian Exp $
.TH PG_DUMP UNIX 1/20/96 PostgreSQL PostgreSQL .TH PG_DUMP UNIX 1/20/96 PostgreSQL PostgreSQL
.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
.SH SYNOPSIS .SH SYNOPSIS
.BR pg_dump .BR pg_dump
[\c [\c
.BR "-f" .BR "-a"
filename
] ]
[\c [\c
.BR "-h" .BR "-d"
hostname
] ]
[\c [\c
.BR "-p" .BR "-D"
port] ]
[\c [\c
.BR "-v" .BR "-f"
filename
] ]
[\c [\c
.BR "-d" .BR "-h"
hostname
] ]
[\c [\c
.BR "-D" .BR "-o"
] ]
[\c [\c
.BR "-S" .BR "-p"
help] port]
[\c [\c
.BR "-a" .BR "-s"
] ]
[\c [\c
.BR "-t" .BR "-t"
table] table]
[\c [\c
.BR "-o" .BR "-v"
] ]
dbname dbname
.in -5n .in -5n
...@@ -62,35 +62,35 @@ in light of the limitations listed below. ...@@ -62,35 +62,35 @@ in light of the limitations listed below.
.PP .PP
pg_dump understands the following options: pg_dump understands the following options:
.TP .TP
.BR "-a" ""
Dump out only the data, no schema
.TP
.BR "-d" ""
Dump data as proper insert strings
.TP
.BR "-D" ""
Dump data as inserts with attribute names
.TP
.BR "-f" " filename" .BR "-f" " filename"
Specifies the output file Specifies the output file
.TP .TP
.BR "-h" " hostname" .BR "-h" " hostname"
Specifies the server host name Specifies the server host name
.TP .TP
.BR "-o" ""
Dump object id's (oids)
.TP
.BR "-p" " port" .BR "-p" " port"
Specifies the server port number Specifies the server port number
.TP .TP
.BR "-v" "" .BR "-s" ""
Specifies verbose mode
.TP
.BR "-d" ""
Dump data as proper insert strings
.TP
.BR "-D" ""
Dump data as inserts with attribute names
.TP
.BR "-S" ""
Dump out only the schema, no data Dump out only the schema, no data
.TP .TP
.BR "-a" ""
Dump out only the data, no schema
.TP
.BR "-t" " table" .BR "-t" " table"
Dump for this table only Dump for this table only
.TP .TP
.BR "-o" "" .BR "-v" ""
Dump object id's (oids) Specifies verbose mode
.PP .PP
If dbname is not supplied, then the DATABASE environment variable value is used. If dbname is not supplied, then the DATABASE environment variable value is used.
.SH "CAVEATS AND LIMITATIONS" .SH "CAVEATS AND LIMITATIONS"
......
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