From: | Rod Taylor <rod(dot)taylor(at)gmail(dot)com> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Asko Oja <ascoja(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Out parameters handling |
Date: | 2009-03-07 17:26:51 |
Message-ID: | 751261b20903070926p39c3e95qb4c490cf86e3ab31@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> actually - function name should be used as label now. This code is working:
Not helpful for me. The most typical conflict I have is actually the
OUT parameter and table name, not a column of the table.
Really don't want to prefix all tables with a hardcoded schema or do
variable substitution for loading the document.
Not fond of prefixing with function name either as a) many of my
functions have very long names and b) they change names occasionally,
particularly during development.
A short prefix like "out" would be useful. I would immediately start
prefixing all uses.
rbt=# begin;
BEGIN
rbt=# create table b (col integer);
CREATE TABLE
rbt=# insert into b values (2);
INSERT 0 1
rbt=# create or replace function fx2(a integer, out b integer) as $$
rbt$# begin
rbt$# SELECT col
rbt$# INTO fx2.b
rbt$# FROM b;
rbt$#
rbt$# return;
rbt$# end; $$ language plpgsql;
ERROR: syntax error at or near "$1"
LINE 1: SELECT col FROM $1
^
QUERY: SELECT col FROM $1
CONTEXT: SQL statement in PL/PgSQL function "fx2" near line 4
rbt=#
From | Date | Subject | |
---|---|---|---|
Next Message | Rod Taylor | 2009-03-07 17:32:49 | Re: Out parameters handling |
Previous Message | Tom Lane | 2009-03-07 17:25:38 | Re: Out parameters handling |