RE: [HACKERS] getting new serial value of serial insert - Mailing list pgsql-hackers

From Aaron J. Seigo
Subject RE: [HACKERS] getting new serial value of serial insert
Date
Msg-id 99110414345002.10841@stilborne
Whole thread Raw
In response to RE: [HACKERS] getting new serial value of serial insert  ("Ansley, Michael" <Michael.Ansley@intec.co.za>)
List pgsql-hackers
hi..

> Why can't this simply be done with a stored proc?  Or am I missing the boat?
> Stored proc accepts parameters to insert, and returns whatever value you
> want it to.
> 

in an earlier post i mentioned that this doesn't do anything FUNCTIONALY new,
it merely allows doing it with EASE and greater SPEED.. 

ease, because you don't have to write a function (not really stored procedure
=) to handle each specific insert and return pair you want.. with RETURN this
would be defined on a per query basis... 

speed, because you would skip the SELECT to get the information.. it would tap
the tuple whilst still in memory during the read, like a tigger... you skip the
SELECt...

last, it allows certain security possibilities: giving people access to the
information they just inserted without giving them general SELECT permissions
on the table(s) involved...

so, no.. you aren't missing the boat by thinking this sort of thing CAN be done
via other methods. the point is merely that the current methods are clumsy and
slow and it seems a number of people are going through the current necessary
hoops... 

-- 
Aaron J. Seigo
Sys Admin


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: packaging of 6.5.3
Next
From: Bruce Momjian
Date:
Subject: Re: packaging of 6.5.3