Search Postgresql Archives

Re: INSERT with RETURNING clause inside SQL function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 4, 2008 at 2:38 AM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
> "Diego Schulz" <dschulz@xxxxxxxxx> writes:
>> On Mon, Nov 3, 2008 at 10:24 PM, Raymond O'Donnell <rod@xxxxxx> wrote:
>>> Just curious - what have you got against currval()? It seems to me that
>>> it would make your life easier....
>
>> I simply don't like having to cast from BIGINT to INTEGER,
>
> Under what circumstances do you need an explicit cast?
>
>                        regards, tom lane
>

When I want the function to return the same type as the index of the
table (normally SERIAL),
and I have other functions that rely on the datatype returned. To
avoid casting I can simply change the function's
signature to return BIGINT (to match currval() return type) and the
problem vanishes but.. then I have more functions
that needs to be adapted.

Maybe I'm a bit paranoid of BIGINT's performance penalty too, as the
set of functions will be heavily
used, but honestly, this fear completely lacks foundation.

Just to make it clear, the main reason for this thread was curiosity :)
Thank you for your time.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux