Re: SET NULL / SET NOT NULL

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: SET NULL / SET NOT NULL
Дата
Msg-id GNELIHDDFBOCMGBFGEFOEENLCBAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-hackers
> ALTER TABLE blah ALTER [COLUMN] col SET NOT NULL;
>
> and
>
> ALTER TABLE blah ALTER [COLUMN] col DROP NOT NULL;
>
> This is synchronous with the SET/DROP default stuff and is
> extensible in the
> future to fit in with column type changing.
>
> Of course, it can always be changed in the parser without
> affecting my code.

Also, in the future, once (if) the 'SET TYPE' column type changing function
has been implemented, we can create a meta-command to do it all in one
statement (for reliability and consistency for users).  It could look like
this:

ALTER TABLE blah ALTER [COLUMN] col [SET TYPE type] [{SET | DROP} NOT NULL]
[{SET | DROP} DEFAULT [default]]

And a command like this should be able to just re-use already written code.
However, some interdependency checks might be more efficient if their done
before any changes are actually made!  ie. Changing type to boolean and then
setting default to 'blah' in one statement, etc.

Chris



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ulrich Neumann
Дата:
Сообщение: Antw: Re: patch for include/utils/datetime.h to target NetWare
Следующее
От: Tom Lane
Дата:
Сообщение: Re: views on temp tables