1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-22 21:53:06 +03:00

Add more dependency insertions --- this completes the basic pg_depend

functionality.  Of note: dropping a table that has a SERIAL column
defined now drops the associated sequence automatically.
This commit is contained in:
Tom Lane
2002-07-16 22:12:20 +00:00
parent cdebcad6af
commit 5af19e4227
19 changed files with 402 additions and 90 deletions

View File

@@ -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.238 2002/07/12 18:43:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.239 2002/07/16 22:12:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -847,6 +847,12 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
cxt->blist = lappend(cxt->blist, seqstmt);
/*
* Mark the ColumnDef so that during execution, an appropriate
* dependency will be added from the sequence to the column.
*/
column->support = makeRangeVar(snamespace, sname);
/*
* Create appropriate constraints for SERIAL. We do this in full,
* rather than shortcutting, so that we will detect any

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.340 2002/07/14 23:38:13 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.341 2002/07/16 22:12:20 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -1852,10 +1852,11 @@ CreateAsElement:
ColumnDef *n = makeNode(ColumnDef);
n->colname = $1;
n->typename = NULL;
n->is_not_null = false;
n->raw_default = NULL;
n->cooked_default = NULL;
n->is_not_null = FALSE;
n->constraints = NULL;
n->constraints = NIL;
n->support = NULL;
$$ = (Node *)n;
}
;