Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 08EF0476BA7 for ; Thu, 13 Jun 2002 18:43:50 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A890E476F6C for ; Thu, 13 Jun 2002 17:50:39 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5DLodb00176; Thu, 13 Jun 2002 17:50:39 -0400 (EDT) To: Tim Ellis Cc: pgsql-admin@postgresql.org Subject: Re: Triggers... Questions... Yes. 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> Comments: In-reply-to Tim Ellis message dated "Thu, 13 Jun 2002 14:32:13 -0700" Date: Thu, 13 Jun 2002 17:50:39 -0400 Message-ID: <173.1024005039@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/96 X-Sequence-Number: 4531 Tim Ellis 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