pseudo-type record arguments for PL-functions - Mailing list pgsql-hackers

From Markus Schiltknecht
Subject pseudo-type record arguments for PL-functions
Date
Msg-id 1146752943.14520.29.camel@fotomarburg
Whole thread Raw
Responses Re: pseudo-type record arguments for PL-functions
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rethinking locking for database create/drop vs connection startup
Next
From: Chris Browne
Date:
Subject: Re: autovacuum logging, part deux.