pseudo-type record arguments for PL-functions

From: Markus Schiltknecht <markus(at)bluegap(dot)ch>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pseudo-type record arguments for PL-functions
Date: 2006-05-04 14:29:03
Message-ID: 1146752943.14520.29.camel@fotomarburg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm trying to write a PL/Python function which is to be called from a
rule. I'd need pass the OLD and NEW tuple records to the function.
Unfortunately that does not work: 'pl/python functions cannot take type
record'.

What I have figured out by reading the source code: OLD and NEW are
pseudo types (otherwise, pl/python would not have thrown that error)
(plpython.c:1088). During parsing of SQL function definitions the
arguments for the function are checked. In a comment I've read:
"Disallow pseudotypes in arguments" (pg_proc:546). I checked the other
PLs and found out, that no one can handle pseudo-arguments.

What exactly are pseudo types? Why are the OLD and NEW records of a rule
pseudo-types? Why can PLs not handle pseudo-types?

Or is it possible to write a C-function which takes the OLD and NEW
records of a rule as arguments? Is there an example of such a thing?

Regards

Markus

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Browne 2006-05-04 14:46:54 Re: autovacuum logging, part deux.
Previous Message Tom Lane 2006-05-04 14:11:46 Re: Rethinking locking for database create/drop vs connection startup