Documentation regarding %ROWTYPE in PL/PgSQL

Поиск
Список
Период
Сортировка
От Andrew McMillan
Тема Documentation regarding %ROWTYPE in PL/PgSQL
Дата
Msg-id 1022492628.22442.1407.camel@kant.mcmillan.net.nz
обсуждение исходный текст
Ответы Re: Documentation regarding %ROWTYPE in PL/PgSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I recently referred to the manual (section 23.3) to work out how to
write a PL/PgSQL function that accepted a row as a parameter.

Reading between a few lines I got the impression that the manual
suggested something like:

CREATE or REPLACE myfunc( tablename%ROWTYPE ) RETURNS ...

When I finally got my function working, I found I had:

CREATE or REPLACE myfunc( tablename ) RETURNS ...

This is brilliant :-), and in fact the manual foreshadows it:

"although one might expect a bare table name to work as a type
declaration, it won't be accepted within
<application>PL/pgSQL</application> functions."

So I guess the manual needs a little update there, or perhaps the syntax
that I used only works in the variable list, so I was lucky.

I would happily supply a patch to the documentation myself, except that
I don't really know what the correct answer is!  The docs get a bit hazy
in this area regarding the differences between function parameters,
declared variables and declared aliases.

If someone wants to supply me with the lowdown (or tell me who they are
and I can quiz them :-) then I will produce a patch for this area.

I'm doing this under 7.2.1, but I've checked CVS as far as I am able and
this appears not to have changed.

Regards,
                    Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/        PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201    MOB: +64(21)635-694    OFFICE: +64(4)499-2267
       Are you enrolled at http://schoolreunions.co.nz/ yet?

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #679: Time input format is no longer ISO 8601 compliant
Следующее
От: Mathieu Arnold
Дата:
Сообщение: Re: pg_dump && aggregate bug