Обсуждение: Help with SET NULL/SET NOT NULL

Поиск
Список
Период
Сортировка

Help with SET NULL/SET NOT NULL

От
"Christopher Kings-Lynne"
Дата:
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!!!

Вложения

Re: SET NULL/SET NOT NULL

От
"Dwayne Miller"
Дата:
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