Re: Triggers... Questions... Yes.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Triggers... Questions... Yes.
Дата
Msg-id 173.1024005039@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Triggers... Questions... Yes.  (Tim Ellis <Tim.Ellis@gamet.com>)
Список pgsql-admin
Tim Ellis <Tim.Ellis@gamet.com> writes:
> Yeh. Good question. I would assume their generator MEANT
> (max(autonum,0)+1) supposing that a "ANSI Level 2"-compliant server's
> max function might return the second value if the first is NULL. But no
> matter how you slice it, that looks syntactically wrong.

I suspected they meant COALESCE(max(autonum),0) + 1, which would be
correct since max() on no values is defined to produce NULL.  I'm
not aware of any variant of max() that takes two arguments.

> Perhaps. Is the sequence object part of standard SQL? I know Postgres and
> Oracle have it (among others) but I also know of at least one major
> recent-version RDBMS that fails to have a sequence object.

It is not standard.  On the other hand, expecting people to have
implemented every last frammish in SQL99 is a bit premature also...
SQL92 didn't have triggers at all.

            regards, tom lane

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

Предыдущее
От: Tim Ellis
Дата:
Сообщение: Re: Triggers... Questions... Yes.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Indexes on separate disk ?