Thread: Help with SET NULL/SET NOT NULL

Help with SET NULL/SET NOT NULL

From
"Christopher Kings-Lynne"
Date:
Hi all,

I did an initial patch for ALTER TABLE / SET NULL that should just say 'not
implemented' when someone tries it, but I get this:

template1=# alter table test alter column a set null;
ERROR:  parser: parse error at or near "null"
template1=# alter table test alter column a set null_p;
ERROR:  parser: parse error at or near "null_p"
template1=# alter table test alter column a set not null;
ERROR:  parser: parse error at or near "not"

What have I missed?

All regression tests pass...

Attached is context diff

I'm pretty sure that I haven't done preproc.y correctly either...

Chris

ps. DON'T COMMIT THIS PATCH!!!

Attachment

Re: SET NULL/SET NOT NULL

From
"Dwayne Miller"
Date:
seems like other systems keep very similar syntax to the CREATE TABLE 
command.  i.e.
ALTER TABLE blah ALTER COLUMN col datatype (precision.scale) NULL
ALTER TABLE blah ALTER COLUMN col datatype (precision.scale) NOT NULL

Dwayne