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
* $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
* heap_create() - Create an uncataloged heap relation
@ -35,26 +35,28 @@
#include <catalog/heap.h>
#include <catalog/index.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_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_type.h>
#include <commands/trigger.h>
#include <nodes/plannodes.h>
#include <optimizer/tlist.h>
#include <parser/parse_expr.h>
#include <parser/parse_node.h>
#include <parser/parse_type.h>
#include <rewrite/rewriteRemove.h>
#include <storage/bufmgr.h>
#include <storage/lmgr.h>
#include <storage/smgr.h>
#include <rewrite/rewriteRemove.h>
#include <tcop/tcopprot.h>
#include <utils/builtins.h>
#include <utils/mcxt.h>
#include <utils/relcache.h>
#include <utils/tqual.h>
#include <nodes/plannodes.h>
#ifndef HAVE_MEMMOVE
#include <regex/utils.h>
#else
@ -1482,10 +1484,6 @@ DestroyTempRels(void)
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
StoreAttrDefault(Relation rel, AttrDefault *attrdef)

View File

@ -21,7 +21,7 @@
*
*
* 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
*
@ -106,30 +106,28 @@ char g_comment_end[10];
static void
usage(const char *progname)
{
fprintf(stderr,
"%s - version 1.13.dhb.2\n\n", progname);
fprintf(stderr,
"usage: %s [options] [dbname]\n", progname);
fprintf(stderr,
"\t -a \t\t dump out only the data, no schema\n");
fprintf(stderr,
"\t -d \t\t dump data as proper insert strings\n");
fprintf(stderr,
"\t -D \t\t dump data as inserts with attribute names\n");
fprintf(stderr,
"\t -f filename \t\t script output filename\n");
fprintf(stderr,
"\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 -v \t\t verbose\n");
fprintf(stderr,
"\t -d \t\t dump data as proper insert strings\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 -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,
"\t -t table \t\t dump for this table only\n");
fprintf(stderr,
"\t -o \t\t dump object id's (oids)\n");
"\t -v \t\t verbose\n");
fprintf(stderr,
"\t -z \t\t dump ACLs (grant/revoke)\n");
fprintf(stderr,
@ -479,24 +477,12 @@ main(int argc, char **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)
{
case 'f': /* output file name */
filename = optarg;
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;
case 'a': /* Dump data only */
dataOnly = 1;
break;
case 'd': /* dump data as proper insert strings */
dumpData = 1;
@ -506,15 +492,27 @@ main(int argc, char **argv)
dumpData = 1;
attrNames = 1;
break;
case 't': /* Dump data for this table only */
tablename = optarg;
case 'f': /* output file name */
filename = optarg;
break;
case 'a': /* Dump data only */
dataOnly = 1;
case 'h': /* server host */
pghost = optarg;
break;
case 'o': /* Dump oids */
oids = 1;
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 */
acls = 1;
break;

View File

@ -7,7 +7,7 @@
*
*
* 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';
}
else
for (i = 0; conn->dbName[i]; i++)
for (i = strlen(conn->dbName[i]); i >= 0; i--)
if (isupper(conn->dbName[i]))
conn->dbName[i] = tolower(conn->dbName[i]);
}

View File

@ -7,7 +7,7 @@
*
*
* 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';
}
else
for (i = 0; field_case; i++)
for (i = strlen(field_case[i]); i >= 0; i--)
if (isupper(field_case[i]))
field_case[i] = tolower(field_case[i]);

View File

@ -1,12 +1,21 @@
.\" This is -*-nroff-*-
.\" 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
.SH NAME
pg_dump \(em dumps out a Postgres database into a script file
.SH SYNOPSIS
.BR pg_dump
[\c
.BR "-a"
]
[\c
.BR "-d"
]
[\c
.BR "-D"
]
[\c
.BR "-f"
filename
]
@ -15,28 +24,19 @@ filename
hostname
]
[\c
.BR "-o"
]
[\c
.BR "-p"
port]
[\c
.BR "-v"
]
[\c
.BR "-d"
]
[\c
.BR "-D"
]
[\c
.BR "-S"
help]
[\c
.BR "-a"
.BR "-s"
]
[\c
.BR "-t"
table]
[\c
.BR "-o"
.BR "-v"
]
dbname
.in -5n
@ -62,17 +62,8 @@ in light of the limitations listed below.
.PP
pg_dump understands the following options:
.TP
.BR "-f" " filename"
Specifies the output file
.TP
.BR "-h" " hostname"
Specifies the server host name
.TP
.BR "-p" " port"
Specifies the server port number
.TP
.BR "-v" ""
Specifies verbose mode
.BR "-a" ""
Dump out only the data, no schema
.TP
.BR "-d" ""
Dump data as proper insert strings
@ -80,17 +71,26 @@ Dump data as proper insert strings
.BR "-D" ""
Dump data as inserts with attribute names
.TP
.BR "-S" ""
Dump out only the schema, no data
.BR "-f" " filename"
Specifies the output file
.TP
.BR "-a" ""
Dump out only the data, no schema
.BR "-h" " hostname"
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
.BR "-t" " table"
Dump for this table only
.TP
.BR "-o" ""
Dump object id's (oids)
.BR "-v" ""
Specifies verbose mode
.PP
If dbname is not supplied, then the DATABASE environment variable value is used.
.SH "CAVEATS AND LIMITATIONS"