anonymous record as an in parameter

From: Maximilian Tyrtania <lists(at)contactking(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: anonymous record as an in parameter
Date: 2011-03-29 13:07:04
Message-ID: 58A91991-5E19-445C-8A00-5E4CAF86EF21@contactking.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kalai R 2011-03-29 13:47:16 Re: Postgres 9 silent installation on Windows
Previous Message tushar nehete 2011-03-29 11:35:04 Re: Autocommit off - commits/rollbacks