Re: set default: question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: set default: question
Дата
Msg-id 22181.1271974615@sss.pgh.pa.us
обсуждение исходный текст
Ответ на set default: question  (Marco Bomben <marco.bomben@gmail.com>)
Список pgsql-novice
Marco Bomben <marco.bomben@gmail.com> writes:
> I've a problem in understanding the "SET DEFAULT" command.
> fssr2db=# ALTER TABLE fssr2calibs ALTER COLUMN  intvbn SET DEFAULT 139;
> ...
> So I do see the effects of SET DEFAULT on the table as a whole (through \d
> <table name>)
> but not on each row (I set the value for some of them and for some not
> before using SET DEFAULT).

SET DEFAULT only establishes a default to use in future INSERT
operations; it doesn't affect any existing rows.  Perhaps you want
to do something like

    UPDATE fssr2calibs SET intvbn = 139 WHERE intvbn IS NULL

in addition to setting the default?

            regards, tom lane

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

Предыдущее
От: jr
Дата:
Сообщение: Re: PostgreSQL Book
Следующее
От: Tim Bunce
Дата:
Сообщение: Re: PLPerl not installed correctly?