Document pg_dump -z, clean up option list. Fix problem with libpq handling of field...
authorBruce Momjian
Mon, 1 Dec 1997 21:01:24 +0000 (21:01 +0000)
committerBruce Momjian
Mon, 1 Dec 1997 21:01:24 +0000 (21:01 +0000)
src/backend/catalog/heap.c
src/bin/pg_dump/pg_dump.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-exec.c
src/man/pg_dump.1

index 2af462fe6ed2e40d88ff2ab11f78860cd9eac2bb..215ebebdea7eabc377ab268ca0a8bc73bb5c0f85 100644 (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
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
-#include 
-#include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include <rewrite/rewriteRemove.h>
+#include <tcop/tcopprot.h>
 #include 
 #include 
 #include 
 #include 
-#include 
 #ifndef HAVE_MEMMOVE
 #include 
 #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)
index 8a40d82fe122389581d36760f6060795732c4e73..5c54ca5184d0af8b7c9b33b1467bedfa627b2cd7 100644 (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 - [email protected] - 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 -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");
+           "\t -d          \t\t dump data as proper insert strings\n");
    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,
-           "\t -v          \t\t verbose\n");
+           "\t -f filename \t\t script output filename\n");
    fprintf(stderr,
-           "\t -d          \t\t dump data as proper insert strings\n");
+           "\t -h hostname \t\t server host name\n");
    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,
-           "\t -S          \t\t dump out only the schema, no data\n");
+           "\t -p port     \t\t server port number\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,41 +477,41 @@ 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 '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 */
                filename = optarg;
                break;
            case 'h':           /* server host */
                pghost = optarg;
                break;
+           case 'o':           /* Dump oids */
+               oids = 1;
+               break;
            case 'p':           /* server port */
                pgport = optarg;
                break;
-           case 'v':           /* verbose */
-               g_verbose = true;
-               break;
-           case 'S':           /* dump schema only */
+           case 's':           /* dump schema only */
                schemaOnly = 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 't':           /* Dump data for this table only */
                tablename = optarg;
                break;
-           case 'a':           /* Dump data only */
-               dataOnly = 1;
-               break;
-           case 'o':           /* Dump oids */
-               oids = 1;
+           case 'v':           /* verbose */
+               g_verbose = true;
                break;
            case 'z':           /* Dump oids */
                acls = 1;
index 8b6648a5eb398775128d9e83ee5d0f3fc5ec842d..b9562fd6ef888475884151fc4c06c6b7bf2d142c 100644 (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]);
        }
index 2f1b55fbd12aad6920337e3ce715f7096c132caa..86fca431cc6477844970675e1c4e47d3dc3ba4ba 100644 (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]);
 
index a03a91d85a2d14de061eb3e200ca259b4e03bc7a..f2fd835b634ca2e3634bbcb398e31da00091ff5b 100644 (file)
@@ -1,42 +1,42 @@
 .\" 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 "-f"
-filename
+.BR "-a"
 ]
 [\c
-.BR "-h"
-hostname
+.BR "-d"
 ]
 [\c
-.BR "-p"
-port]
+.BR "-D"
+]
 [\c
-.BR "-v"
+.BR "-f"
+filename
 ]
 [\c
-.BR "-d"
+.BR "-h"
+hostname
 ]
 [\c
-.BR "-D"
+.BR "-o"
 ]
 [\c
-.BR "-S"
-help]
+.BR "-p"
+port]
 [\c
-.BR "-a"
+.BR "-s"
 ]
 [\c
 .BR "-t"
 table]
 [\c
-.BR "-o"
+.BR "-v"
 ]
 dbname
 .in -5n
@@ -62,35 +62,35 @@ in light of the limitations listed below.
 .PP
 pg_dump understands the following options:
 .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"
 Specifies the output file
 .TP
 .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 "-v" ""
-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" ""
+.BR "-s" ""
 Dump out only the schema, no data
 .TP
-.BR "-a" ""
-Dump out only the data, no schema
-.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"