Bug #709: PL/pgSQL Parameter Of Composite Type

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #709: PL/pgSQL Parameter Of Composite Type
Дата
Msg-id 20020712005848.31E18475A34@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
CNLIOU (cnliou@eurosport.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
PL/pgSQL Parameter Of Composite Type

Long Description
Hello!

"Example 23-4. A PL/pgSQL Function on Composite Type" says that we are allowed to pass record to pl/pgsql, but actually
weare not. Perhaps either the online document or the TODO list should be revised.
 

Regards,

CN

Sample Code
CREATE TABLE table3(column1 integer);

CREATE FUNCTION test2(table3) RETURNS TEXT AS '
DECLARE
  rec ALIAS FOR $1;
BEGIN
 RETURN rec.column1;
END;' LANGUAGE 'plpgsql';

CREATE FUNCTION test1() RETURNS TEXT AS '
DECLARE
  rec RECORD; --or "rec table3%ROWTYPE;
BEGIN
 SELECT * INTO rec FROM table3 LIMIT 1;
 RETURN test2(rec);
END;' LANGUAGE 'plpgsql';

Gets:
database=# select test1();
NOTICE:  Error occurred while executing PL/pgSQL function test1
NOTICE:  line 5 at return
ERROR:  Attribute 'rec' not found

No file was uploaded with this report

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug #708: PgTransaction class is broken since 7.2
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #710: Fail To Create/Drop Temporary Table IN PL/PGSQL