pseudo-type record arguments for PL-functions

Поиск
Список
Период
Сортировка
От Markus Schiltknecht
Тема pseudo-type record arguments for PL-functions
Дата
Msg-id 1146752943.14520.29.camel@fotomarburg
обсуждение исходный текст
Ответы Re: pseudo-type record arguments for PL-functions
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Rethinking locking for database create/drop vs connection startup
Следующее
От: Chris Browne
Дата:
Сообщение: Re: autovacuum logging, part deux.