Skip site navigation (1) Skip section navigation (2)

Re: pg_proc probin misuse

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James William Pye <pgsql(at)jwp(dot)name>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_proc probin misuse
Date: 2006-05-27 03:21:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
James William Pye <pgsql(at)jwp(dot)name> writes:
> In PL/Py, I had the bright idea of storing bytecode in the probin field of the
> function's pg_proc row. However, this idea has lately become rather dim as I
> have recently rediscovered(thanks Adrian) that this breaks dumps; pg_dump outputs
> a PL/Py function as "CREATE FUNCTION x() RETURNS y LANGUAGE python AS
> '<bytecode>', '<source>'". Of course, when loading this, it fails:
> 'ERROR:  only one AS item needed for language "python"'.

> So is this "fix your broken PL" or "pg_dump should only be doing that for C
> language functions"?

Offhand it seems to me that pg_dump is behaving reasonably: it's storing
probin if it sees something there to be stored.  The asymmetry is in the
backend, specifically functioncmds.c's interpret_AS_clause(): it has a
hardwired assumption that probin is only relevant to C functions.

Feel free to propose a saner definition.  AFAICS the current coding
makes probin useless for all except C functions, so I think it could
be improved.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Hannu KrosingDate: 2006-05-27 08:05:44
Subject: Re: Updatable views/with check option parsing
Previous:From: Tom LaneDate: 2006-05-27 02:50:39
Subject: Re: Updatable views/with check option parsing

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group