summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dump.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-08-21 00:57:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-08-21 00:57:26 +0000
commit2b2a50722cb1863147b4a86b3db80553f989a14c (patch)
tree46bf05accbbb3e8dec43cfc0e55c99e4615ee337 /src/bin/pg_dump/pg_dump.h
parentdf18c51f2955f6dc30027c91546a607abd699c40 (diff)
downloadpostgresql-2b2a50722cb1863147b4a86b3db80553f989a14c.tar.gz
Fix all known problems with pg_dump's handling of serial sequences
by abandoning the idea that it should say SERIAL in the dump. Instead, dump serial sequences and column defaults just like regular ones. Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate the sequence-to-column dependency that was formerly created "behind the scenes" by SERIAL. This restores SERIAL to being truly "just a macro" consisting of component operations that can be stated explicitly in SQL. Furthermore, the new command allows sequence ownership to be reassigned, so that old mistakes can be cleaned up. Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there is no longer any very compelling argument why the sequence couldn't be dropped while keeping the column. (This forces initdb, to be sure the right kinds of dependencies are in there.) Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an owned sequence; you can now only do this indirectly by changing the owning table's owner or schema. This is an oversight in previous releases, but probably not worth back-patching.
Diffstat (limited to 'src/bin/pg_dump/pg_dump.h')
-rw-r--r--src/bin/pg_dump/pg_dump.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 3650ae50de..65f5e84c41 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.128 2006/08/01 18:05:04 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.129 2006/08/21 00:57:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -185,7 +185,7 @@ typedef struct _tableInfo
bool hasoids; /* does it have OIDs? */
int ncheck; /* # of CHECK expressions */
int ntrig; /* # of triggers */
- /* these two are set only if table is a SERIAL column's sequence: */
+ /* these two are set only if table is a sequence owned by a column: */
Oid owning_tab; /* OID of table owning sequence */
int owning_col; /* attr # of column owning sequence */
@@ -204,7 +204,6 @@ typedef struct _tableInfo
char *typstorage; /* type storage scheme */
bool *attisdropped; /* true if attr is dropped; don't dump it */
bool *attislocal; /* true if attr has local definition */
- bool *attisserial; /* true if attr is serial or bigserial */
/*
* Note: we need to store per-attribute notnull, default, and constraint