Re: anonymous record as an in parameter

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: anonymous record as an in parameter
Дата
Msg-id AANLkTikV92SHsds7uBSr4nb75UEFcDuhKSeGRaA6=RzM@mail.gmail.com
обсуждение исходный текст
Ответ на anonymous record as an in parameter  (Maximilian Tyrtania <lists@contactking.de>)
Список pgsql-general
On Tue, Mar 29, 2011 at 8:07 AM, Maximilian Tyrtania
<lists@contactking.de> wrote:
> Hi there,
>
> i'd like to write a function (sql or plpgsql) that takes an anonymous record as an in parameter. You know, kind of
like(simplified): 
>
> create function f_tablename (p_anyrecord record) returns text as
> $body$
> select $1.tableoid::regclass::text
> $body$
> language sql;
>
> ...but PG 9.0.3 doesn't like that:
> ERROR:  SQL functions cannot have arguments of type record. It also doesn't work with plpgsql.
> Is there a way?

yes, in C, which is maybe 10 notches up in the difficulty level. my
advice is to cast the record to text, or use an hstore.

merlin

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Autocommit off - commits/rollbacks
Следующее
От: Ogden
Дата:
Сообщение: Load Increase