Re: SET NULL / SET NOT NULL

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: SET NULL / SET NOT NULL
Дата
Msg-id 3C745E24.94B34DC5@fourpalms.org
обсуждение исходный текст
Ответ на Re: SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Ответы Re: SET NULL / SET NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
(our mail crossed in the ether...)

> Let's say, theoretically, that in the future we want to allow people to
> change the type of their columns, plus allow them to change the nullability.

Right.

> Should we come up with a syntax for changing nullability that allows for the
> future changing of column type?  If so, then a syntaxes like these might be
> the way to go:

Yup.

> If we just allow the full col spec we could one day support this:
> ALTER TABLE blah ALTER COLUMN col text boolean NOT NULL DEFAULT 'f';
> Which would change the column to that definition (if coercion is possible)
> no matter what current definition is...

Right. No point in *precluding* that with a short-sighted choice of
syntax.

> Is this the eventual goal?  Will this cause shift/reduce errors? will we
> need to put the word 'SET' in after 'col'?

Probably not, if we can already do this with CREATE TABLE.

And if we head this direction, then choosing a syntax which most closely
mimics the current CREATE TABLE will allow altering two columns at once,
which would be more efficient presumably than doing one column at a
time.
                   - Thomas


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

Предыдущее
От: Sean Chittenden
Дата:
Сообщение: Re: A Replication Idea
Следующее
От: Philip Warner
Дата:
Сообщение: Re: SET NULL / SET NOT NULL