new -x option to skip acl dump.
To dump your fairly recent post-v6.0 database installation, type
<programlisting>
-$ pg_dumpall -z > db.out
+$ pg_dumpall > db.out
</programlisting>
</para>
<para>
$ gunzip -c postgresql-v6.5.tar.gz \
| tar xvf - src/bin/pg_dump/pg_dumpall
$ chmod a+x src/bin/pg_dump/pg_dumpall
-$ src/bin/pg_dump/pg_dumpall -z > db.out
+$ src/bin/pg_dump/pg_dumpall > db.out
$ rm -rf src
</ProgramListing>
</Para>
pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
[ -t <replaceable class="parameter">table</replaceable> ]
[ -f <replaceable class="parameter">outputfile</replaceable> ]
- [ -a ] [ -c ] [ -d ] [ -D ] [ -n ] [ -N ] [ -o ] [ -s ] [ -u ] [ -v ] [ -z ]
+ [ -a ] [ -c ] [ -d ] [ -D ] [ -n ] [ -N ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
[ <replaceable class="parameter">dbname</replaceable> ]
</SYNOPSIS>
<varlistentry>
<term>
- -z
+ -x
</term>
<listitem>
<para>
- Include ACLs (grant/revoke commands) and table ownership information.
+ Prevent dumping of ACLs (grant/revoke commands) and table ownership information.
</para>
</listitem>
</varlistentry>
<SYNOPSIS>
pg_dumpall
pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
- [ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -z ]
+ [ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
</SYNOPSIS>
<REFSECT2 ID="R2-APP-PG-DUMPALL-1">
<varlistentry>
<term>
- -z
+ -x
</term>
<listitem>
<para>
- Include ACLs (grant/revoke commands) and table ownership information.
+ Prevent dumping ACLs (grant/revoke commands) and table ownership information.
</para>
</listitem>
</varlistentry>
PostgreSQL release without reloading all the data. First,
to be safe, back up your data directory. Then, use:
<programlisting>
-% pg_dumpall -s -z >db.out
+% pg_dumpall -s >db.out
</programlisting>
to dump out your old database definitions without any
data. Stop the postmaster and all backends.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.31 1999/05/26 21:51:13 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.32 1999/05/27 16:29:03 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
dumpSchema(FILE *fout,
int *numTablesPtr,
const char *tablename,
- const bool acls)
+ const bool aclsSkip)
{
int numTypes;
int numFuncs;
fprintf(stderr, "%s dumping out tables %s\n",
g_comment_start, g_comment_end);
dumpTables(fout, tblinfo, numTables, inhinfo, numInherits,
- tinfo, numTypes, tablename, acls);
+ tinfo, numTypes, tablename, aclsSkip);
}
if (!tablename && fout)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.112 1999/05/26 21:51:12 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.113 1999/05/27 16:29:03 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
bool attrNames; /* put attr names into insert strings */
bool schemaOnly;
bool dataOnly;
-bool aclsOption;
+bool aclsSkip;
bool dropSchema;
char g_opaque_type[10]; /* name for the opaque type */
char tmp_string[128];
char username[100];
char password[100];
- int use_password = 0;
+ bool use_password = false;
g_verbose = false;
force_quotes = true;
progname = *argv;
- while ((c = getopt(argc, argv, "acdDf:h:nNop:st:vzu")) != EOF)
+ while ((c = getopt(argc, argv, "acdDf:h:nNop:st:uvxz")) != EOF)
{
switch (c)
{
}
}
break;
+ case 'u':
+ use_password = true;
+ break;
case 'v': /* verbose */
g_verbose = true;
break;
- case 'z': /* Dump ACLs and table ownership info */
- aclsOption = true;
+ case 'x': /* skip ACL dump */
+ aclsSkip = true;
break;
- case 'u':
- use_password = 1;
+ case 'z': /* Old ACL option bjm 1999/05/27 */
+ fprintf(stderr,
+ "%s: The -z option(dump ACLs) is now the default, continuing.\n",
+ progname);
break;
default:
usage(progname);
if (g_verbose)
fprintf(stderr, "%s last builtin oid is %u %s\n",
g_comment_start, g_last_builtin_oid, g_comment_end);
- tblinfo = dumpSchema(g_fout, &numTables, tablename, aclsOption);
+ tblinfo = dumpSchema(g_fout, &numTables, tablename, aclsSkip);
}
else
- tblinfo = dumpSchema(NULL, &numTables, tablename, aclsOption);
+ tblinfo = dumpSchema(NULL, &numTables, tablename, aclsSkip);
if (!schemaOnly)
dumpClasses(tblinfo, numTables, g_fout, tablename, oids);
dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits,
TypeInfo *tinfo, int numTypes, const char *tablename,
- const bool acls)
+ const bool aclsSkip)
{
int i,
j,
{
becomeUser(fout, tblinfo[i].usename);
dumpSequence(fout, tblinfo[i]);
- if (acls)
+ if (!aclsSkip)
dumpACL(fout, tblinfo[i]);
}
}
strcat(q, ";\n");
fputs(q, fout);
- if (acls)
+ if (!aclsSkip)
dumpACL(fout, tblinfo[i]);
}
{
static const char *lastusername = "";
- if (!aclsOption)
+ if (aclsSkip)
return;
if (strcmp(lastusername, username) == 0)
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.16 1999/01/21 22:53:37 momjian Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.17 1999/05/27 16:29:05 momjian Exp $
.TH PG_DUMP UNIX 7/15/98 PostgreSQL PostgreSQL
.SH NAME
pg_dump - dumps out a Postgres database into a script file
.BR "-v"
]
[\c
-.BR "-z"
+.BR "-x"
]
dbname
.in -5n
.BR "-v" ""
Specifies verbose mode
.TP
-.BR "-z" ""
-Include ACLs (grant/revoke commands) and table ownership information
+.BR "-x" ""
+Prevent dumping of ACLs (grant/revoke commands) and table ownership information
.PP
If dbname is not supplied, then the DATABASE environment variable value is used.
.SH "CAVEATS AND LIMITATIONS"