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

This commit is contained in:
Bruce Momjian 1997-12-01 21:01:24 +00:00
parent df823bc42d
commit dfc1a6a848
5 changed files with 76 additions and 80 deletions

View File

@ -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 @@
#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_inherits.h>
#include <catalog/pg_proc.h>
#include <catalog/pg_index.h>
#include <catalog/pg_type.h>
#include <catalog/pg_attrdef.h> #include <catalog/pg_attrdef.h>
#include <catalog/pg_index.h>
#include <catalog/pg_inherits.h>
#include <catalog/pg_ipl.h>
#include <catalog/pg_proc.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)
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)

View File

@ -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];
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,
"\t -h hostname \t\t server host name\n");
fprintf(stderr,
"\t -p port \t\t server port number\n");
fprintf(stderr,
"\t -v \t\t verbose\n");
fprintf(stderr, fprintf(stderr,
"\t -d \t\t dump data as proper insert strings\n"); "\t -d \t\t dump data as proper insert strings\n");
fprintf(stderr, fprintf(stderr,
"\t -D \t\t dump data as inserts with attribute names\n"); "\t -D \t\t dump data as inserts with attribute names\n");
fprintf(stderr, fprintf(stderr,
"\t -S \t\t dump out only the schema, no data\n"); "\t -f filename \t\t script output filename\n");
fprintf(stderr, fprintf(stderr,
"\t -a \t\t dump out only the data, no schema\n"); "\t -h hostname \t\t server host name\n");
fprintf(stderr,
"\t -o \t\t dump object id's (oids)\n");
fprintf(stderr,
"\t -p port \t\t server port number\n");
fprintf(stderr,
"\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,24 +477,12 @@ 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 'f': /* output file name */ case 'a': /* Dump data only */
filename = optarg; dataOnly = 1;
break;
case 'h': /* server host */
pghost = optarg;
break;
case 'p': /* server port */
pgport = optarg;
break;
case 'v': /* verbose */
g_verbose = true;
break;
case 'S': /* dump schema only */
schemaOnly = 1;
break; break;
case 'd': /* dump data as proper insert strings */ case 'd': /* dump data as proper insert strings */
dumpData = 1; dumpData = 1;
@ -506,15 +492,27 @@ main(int argc, char **argv)
dumpData = 1; dumpData = 1;
attrNames = 1; attrNames = 1;
break; break;
case 't': /* Dump data for this table only */ case 'f': /* output file name */
tablename = optarg; filename = optarg;
break; break;
case 'a': /* Dump data only */ case 'h': /* server host */
dataOnly = 1; pghost = optarg;
break; break;
case 'o': /* Dump oids */ case 'o': /* Dump oids */
oids = 1; oids = 1;
break; break;
case 'p': /* server port */
pgport = optarg;
break;
case 's': /* dump schema only */
schemaOnly = 1;
break;
case 't': /* Dump data for this table only */
tablename = optarg;
break;
case 'v': /* verbose */
g_verbose = true;
break;
case 'z': /* Dump oids */ case 'z': /* Dump oids */
acls = 1; acls = 1;
break; break;

View File

@ -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
*(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]);
} }

View File

@ -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)
*(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]);

View File

@ -1,12 +1,21 @@
.\" 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 "-a"
]
[\c
.BR "-d"
]
[\c
.BR "-D"
]
[\c
.BR "-f" .BR "-f"
filename filename
] ]
@ -15,28 +24,19 @@ filename
hostname hostname
] ]
[\c [\c
.BR "-o"
]
[\c
.BR "-p" .BR "-p"
port] port]
[\c [\c
.BR "-v" .BR "-s"
]
[\c
.BR "-d"
]
[\c
.BR "-D"
]
[\c
.BR "-S"
help]
[\c
.BR "-a"
] ]
[\c [\c
.BR "-t" .BR "-t"
table] table]
[\c [\c
.BR "-o" .BR "-v"
] ]
dbname dbname
.in -5n .in -5n
@ -62,17 +62,8 @@ in light of the limitations listed below.
.PP .PP
pg_dump understands the following options: pg_dump understands the following options:
.TP .TP
.BR "-f" " filename" .BR "-a" ""
Specifies the output file Dump out only the data, no schema
.TP
.BR "-h" " hostname"
Specifies the server host name
.TP
.BR "-p" " port"
Specifies the server port number
.TP
.BR "-v" ""
Specifies verbose mode
.TP .TP
.BR "-d" "" .BR "-d" ""
Dump data as proper insert strings Dump data as proper insert strings
@ -80,17 +71,26 @@ Dump data as proper insert strings
.BR "-D" "" .BR "-D" ""
Dump data as inserts with attribute names Dump data as inserts with attribute names
.TP .TP
.BR "-S" "" .BR "-f" " filename"
Dump out only the schema, no data Specifies the output file
.TP .TP
.BR "-a" "" .BR "-h" " hostname"
Dump out only the data, no schema Specifies the server host name
.TP
.BR "-o" ""
Dump object id's (oids)
.TP
.BR "-p" " port"
Specifies the server port number
.TP
.BR "-s" ""
Dump out only the schema, no data
.TP .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"