From b992e200b8872ecb6652ec85111995f8d4c5aee0 Mon Sep 17 00:00:00 2001 From: "Vadim B. Mikheev" Date: Tue, 19 Aug 1997 04:46:15 +0000 Subject: NOT NULL implementation (submitted by Robson Paniago de Miranda). --- src/backend/commands/command.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/command.c') diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 74941993e47..6cbe9bda767 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.9 1997/08/18 20:52:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.10 1997/08/19 04:43:27 vadim Exp $ * * NOTES * The PortalExecutorHeapMemory crap needs to be eliminated @@ -279,7 +279,11 @@ PerformAddAttribute(char *relationName, elog(WARN, "PerformAddAttribute: you do not own class \"%s\"", relationName); #endif - + /* + * we can't add a not null attribute + */ + if (colDef->is_not_null) + elog(WARN,"Can't add a not null attribute to a existent relation"); /* * if the first element in the 'schema' list is a "*" then we are * supposed to add this attribute to all classes that inherit from @@ -454,6 +458,7 @@ PerformAddAttribute(char *relationName, attribute->attcacheoff = -1; attribute->attisset = (bool) (form->typtype == 'c'); attribute->attalign = form->typalign; + attribute->attnotnull = false; heap_insert(attrdesc, attributeTuple); if (hasindex) -- cgit v1.2.3