anonymous record as an in parameter - Mailing list pgsql-general

From Maximilian Tyrtania
Subject anonymous record as an in parameter
Date
Msg-id 58A91991-5E19-445C-8A00-5E4CAF86EF21@contactking.de
Whole thread Raw
Responses Re: anonymous record as an in parameter  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
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?

Best wishes from Berlin,
Maximilian Tyrtania

Maximilian Tyrtania Software-Entwicklung
10969 Berlin
http://www.contactking.de


pgsql-general by date:

Previous
From: tushar nehete
Date:
Subject: Re: Autocommit off - commits/rollbacks
Next
From: Kalai R
Date:
Subject: Re: Postgres 9 silent installation on Windows