1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Disallow changing/dropping default expression of a SERIAL column

Dhanaraj M
This commit is contained in:
Bruce Momjian
2006-06-27 03:21:55 +00:00
parent ba4b9c0d8c
commit 424b8e64c7
5 changed files with 149 additions and 5 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.185 2006/06/16 18:42:21 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.186 2006/06/27 03:21:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -3365,6 +3365,11 @@ ATExecColumnDefault(Relation rel, const char *colName,
* safety, but at present we do not expect anything to depend on the
* default.
*/
if (newDefault)
RemoveSequenceDefault(RelationGetRelid(rel), attnum, DROP_RESTRICT, false);
else
RemoveSequenceDefault(RelationGetRelid(rel), attnum, DROP_RESTRICT, true);
RemoveAttrDefault(RelationGetRelid(rel), attnum, DROP_RESTRICT, false);
if (newDefault)