aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/analyze.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-19 19:33:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-19 19:33:36 +0000
commita0bf1a7f2e27944ef9e3bd3b5940ca511cbc333e (patch)
treeb2f011c22e8a9d9c5ff92c6886a5940b8a5020a6 /src/backend/parser/analyze.c
parent6ebc90b0455ffe9dc0bcaf85185b2746008003f6 (diff)
downloadpostgresql-a0bf1a7f2e27944ef9e3bd3b5940ca511cbc333e.tar.gz
postgresql-a0bf1a7f2e27944ef9e3bd3b5940ca511cbc333e.zip
Fix pg_dump to dump serial columns as serials. Per pghackers discussion,
cause SERIAL column declaration not to imply UNIQUE, so that this can be done without creating an extra index.
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r--src/backend/parser/analyze.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 94a367885e3..1890f01c6f0 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.241 2002/08/19 15:08:47 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.242 2002/08/19 19:33:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -877,11 +877,6 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
column->constraints = lappend(column->constraints, constraint);
constraint = makeNode(Constraint);
- constraint->contype = CONSTR_UNIQUE;
- constraint->name = NULL; /* assign later */
- column->constraints = lappend(column->constraints, constraint);
-
- constraint = makeNode(Constraint);
constraint->contype = CONSTR_NOTNULL;
column->constraints = lappend(column->constraints, constraint);
}
@@ -1209,10 +1204,9 @@ transformIndexConstraints(ParseState *pstate, CreateStmtContext *cxt)
/*
* Scan the index list and remove any redundant index specifications.
- * This can happen if, for instance, the user writes SERIAL PRIMARY
- * KEY or SERIAL UNIQUE. A strict reading of SQL92 would suggest
- * raising an error instead, but that strikes me as too
- * anal-retentive. - tgl 2001-02-14
+ * This can happen if, for instance, the user writes UNIQUE PRIMARY KEY.
+ * A strict reading of SQL92 would suggest raising an error instead,
+ * but that strikes me as too anal-retentive. - tgl 2001-02-14
*
* XXX in ALTER TABLE case, it'd be nice to look for duplicate
* pre-existing indexes, too.
@@ -1262,7 +1256,7 @@ transformIndexConstraints(ParseState *pstate, CreateStmtContext *cxt)
/*
* Finally, select unique names for all not-previously-named indices,
- * and display WARNING messages.
+ * and display NOTICE messages.
*
* XXX in ALTER TABLE case, we fail to consider name collisions against
* pre-existing indexes.