Re: help please

Поиск
Список
Период
Сортировка
От frbn
Тема Re: help please
Дата
Msg-id 3D75D12C.6030001@efbs-seafrigo.fr
обсуждение исходный текст
Ответ на help please  ("Dorward Villaruz" <dorwardv@ntsp.nec.co.jp>)
Ответы clog problem  (Bob Parkinson <rwp@biome.ac.uk>)
Список pgsql-general
Dorward Villaruz a écrit:
> i need to create a table with this property
>
>
>  the fields are f1 integer , f2 integer , f3 integer defaults to f1 + f2

you shouldn't store f1+f2, as you already store f1 and f2.

> i have created  something like this
>
>
> create table table1(a integer not null unique primary key, b integer not
> null, c not null default a + b)

"you can't use attributes in the default clause"

if you *really* want to do that, use a trigger after insert: update f3 with f1+f2



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

Предыдущее
От: Curt Sampson
Дата:
Сообщение: A Testimonial
Следующее
От: Bob Parkinson
Дата:
Сообщение: clog problem