Re: database constraints

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема Re: database constraints
Дата
Msg-id 41641616.7050909@fireserve.net
обсуждение исходный текст
Ответ на database constraints  (Ben <bench@silentmedia.com>)
Список pgsql-general
Use a post trigger function, ON UPDATE, INSERT which essentially has
this in it:

if ( ISNULL(new.a) AND ISNULL(new.b) ){ RAISE NOTICE "blah blah"; }

I work with PHP a lot, just a little plpgsql, so, the grammar may be
wrong above.
Ben <bench@silentmedia.com> wrote:
<quote --------------------------------------------------------------->
If I have have the table:

create table foo
(
    a int references bar(id),
    b int references baz(id)
)

... how do I make sure one and only one of the columns a and b are
non-null? Is it even reasonable?
</quote -------------------------------------------------------------->

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

Предыдущее
От: Mark Gibson
Дата:
Сообщение: Re: Cache lookup failed for relation, when trying to DROP
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cache lookup failed for relation, when trying to DROP