Re: Default values?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Default values?
Дата
Msg-id 00cd01c09a55$e27cc7e0$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на Default values?  (brichard@cafod.org.uk (Bruce Richardson))
Список pgsql-general
From: "Bruce Richardson" <brichard@cafod.org.uk>


> If I wanted to create a table in such a way that the default value of
> one column is the value of another column (or the oid value), is there
> a way to do that in the CREATE TABLE statement (with the DEFAULT
> keyword, I'd imagine)?  Or would I need to create a trigger?
>
> --
> Bruce

Trigger AFAIK. I've used functions in DEFAULTs but get errors with
references to another column. I presume it's because the system can't tell
whether your mean OLD.col or NEW.col

- Richard Huxton


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

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: .TO_CHAR problem
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Re: not using table aliases in where clause slow-down?