Re: [HACKERS] getting new serial value of serial insert

From: wieck(at)debis(dot)com (Jan Wieck)
To: aaron(at)gtv(dot)ca (Aaron J(dot) Seigo)
Cc: ELOEHR(at)austin(dot)rr(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] getting new serial value of serial insert
Date: 1999-11-04 03:18:30
Message-ID: m11jDPy-0003kLC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> hi...
>
> >
> > No, and I'm not sure it'd be good to couple the two operations syntactically
> > even if one thought of a clever way to do it. Serial-insert value retrieval is
> > a very frequent lightweight operation that fits nicely within current INSERT
> > syntax, and thus it seems intuitively "natural" to stretch INSERT semantics
> > in this way.
>
> put that way, i can see your point clearly and agree... =)
>
> i think this would be a nice addition to pgsql...
>
> > In the trigger scenario you mention, I'd be slightly more inclined to say it
> > crosses the fuzzy gray line into the area where a subsequent SELECT is in
> > order, as opposed to modifying INSERT syntax/semantics to allow this
> > SELECT functionality. How's that for fuzzy logic?

Don't forget about a BEFORE ROW trigger that decides to
return a NULL tuple instead of a valid (maybe modified)
tuple. Thus, it suppresses the entire INSERT, UPDATE or
DELETE operation silently. You cannot access a plain value
then without having a flag telling that there is a value at
all.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 1999-11-04 03:41:21 Re: [HACKERS] PostgreSQL 6.5.3 built, but not released ...
Previous Message Bruce Momjian 1999-11-04 02:32:17 Re: [HACKERS] PostgreSQL 6.5.3 built, but not released ...