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

From Tom Lane
Subject Re: Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?)
Date
Msg-id 20419.1072368671@sss.pgh.pa.us
Whole thread Raw
In response to Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?)  ("ezra epstein" <ee_newsgroup_post@prajnait.com>)
List pgsql-general
"ezra epstein" <ee_newsgroup_post@prajnait.com> writes:
> CREATE OR REPLACE FUNCTION test(INTEGER)
>     RETURNS doof%ROWTYPE AS '

As somebody else pointed out, just write "doof" and you are done.
%ROWTYPE is an Oracle-ism that we support in the bodies of plpgsql
functions for compatibility's sake, but not elsewhere.

BTW, there is a related notation that we do support in CREATE FUNCTION
argument and result type declarations:
    table.field % TYPE
for naming a type by reference to a field that has that type.

            regards, tom lane

pgsql-general by date:

Previous
From: Martin Marques
Date:
Subject: Re: Installing Postgres w/RH9
Next
From: Tom Lane
Date:
Subject: Re: SELECT INTO broken (?) in PL/pgSQL when using a set returning function in FROM clause (BGUG?)