Search Postgresql Archives

Re: avoid replace of column with variable in pgsql function

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

 



Gerhard Heift <ml-postgresql-20081012-3518@xxxxxxxxx> writes:
> I have a function with an out variable in which I have an INSERT
> statement with the same name as column. Is it possible to avoid the
> replacement?

No, but you could rename the variable.  If you don't want to change the
externally exposed name, try using RENAME:

CREATE FUNCTION insert_foo(IN bar integer, OUT id integer) AS
$BODY$
declare rename id to _id;
BEGIN
  INSERT INTO t1 (id, value) VALUES (bar, bar || '-bar');
  SELECT id INTO _id FROM ...

			regards, tom lane

-- 
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