pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Ellis <Tim.Ellis@gamet.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Triggers... Questions... Yes.
Date: Thu, 13 Jun 2002 17:50:39 -0400
Message-ID: <173.1024005039@sss.pgh.pa.us> (raw)
In-Reply-To: <20020613143213.1d375e2f.Tim.Ellis@gamet.com>
References: <20020613124835.6e182cd4.Tim.Ellis@gamet.com>
	<29650.1024002262@sss.pgh.pa.us>
	<20020613143213.1d375e2f.Tim.Ellis@gamet.com>

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



view thread (5+ messages)

Message-ID: <173.1024005039@sss.pgh.pa.us>
Permalink:  ../173.1024005039@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/173.1024005039@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Tim.Ellis@gamet.com
  Subject: Re: Triggers... Questions... Yes.
  In-Reply-To: <173.1024005039@sss.pgh.pa.us>
  References: <20020613124835.6e182cd4.Tim.Ellis@gamet.com> <29650.1024002262@sss.pgh.pa.us> <20020613143213.1d375e2f.Tim.Ellis@gamet.com> <173.1024005039@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox