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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "ezra epstein" <ee_newsgroup_post(at)prajnait(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Parser does not like %ROWTYPE in the RETURNS clause of a function declaration (BUG?)
Date: 2003-12-25 16:11:11
Message-ID: 20419.1072368671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"ezra epstein" <ee_newsgroup_post(at)prajnait(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-12-25 16:15:21 Re: SELECT INTO broken (?) in PL/pgSQL when using a set returning function in FROM clause (BGUG?)
Previous Message Martin Marques 2003-12-25 16:11:02 Re: Installing Postgres w/RH9