Re: Triggers... Questions... Yes. - Mailing list pgsql-admin

From Tom Lane
Subject Re: Triggers... Questions... Yes.
Date
Msg-id 173.1024005039@sss.pgh.pa.us
Whole thread Raw
In response to Re: Triggers... Questions... Yes.  (Tim Ellis <Tim.Ellis@gamet.com>)
List 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 by date:

Previous
From: Tim Ellis
Date:
Subject: Re: Triggers... Questions... Yes.
Next
From: Tom Lane
Date:
Subject: Re: Indexes on separate disk ?