Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?) - Mailing list pgsql-general

From ezra epstein
Subject Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?)
Date
Msg-id z_OcnWQ51pRub3WiXTWc-g@speakeasy.net
Whole thread Raw
Responses Re: Parser does not like %ROWTYPE in the RETURNS clause
Re: Parser does not like %ROWTYPE in the RETURNS clause of a
Re: Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?)
List pgsql-general
Aother head banger for me.

Below is a complete example of the code

Using Postgres 7.4,
  the function "test" gets this:   psql:temp3.sql:10: ERROR:  syntax error
at or near "%" at character 135
  the function "test2" gets this:  psql:temp3.sql:10: ERROR:  syntax error
at or near "ROWTYPE" at character 141

Very odd.  The first doesn't even like the '%' character -- perhaps because
doof is a table type rather than a column (domain) type???

And when we schema qualify the name of the table then the % is ok, but
ROWTYPE is not.

Is this a well-known limitation or a new (7.4) bug?   I tried combing the
docs to no avail.

Thanks,

   Ezra E.

<code>
/*
 CREATE TABLE doof ( "pk_id"         serial )
  WITHOUT OIDS;
*/

CREATE OR REPLACE FUNCTION test(INTEGER)
    RETURNS doof%ROWTYPE AS '
SELECT * FROM doof WHERE pk_id=$1;
 ' LANGUAGE SQL STABLE RETURNS NULL ON NULL INPUT;

CREATE OR REPLACE FUNCTION test2(INTEGER)
    RETURNS public.doof%ROWTYPE AS '
SELECT * FROM doof WHERE pk_id=$1;
 ' LANGUAGE SQL STABLE RETURNS NULL ON NULL INPUT;
 </code>



pgsql-general by date:

Previous
From: "ezra epstein"
Date:
Subject: SELECT INTO broken (?) in PL/pgSQL when using a set returning function in FROM clause (BGUG?)
Next
From: Lynn.Tilby@asu.edu
Date:
Subject: Installing Postgres w/RH9