Re: plperl - put schema-name in $_TD - Mailing list pgsql-patches

From Tom Lane
Subject Re: plperl - put schema-name in $_TD
Date
Msg-id 1030.1148499667@sss.pgh.pa.us
Whole thread Raw
In response to Re: plperl - put schema-name in $_TD  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: plperl - put schema-name in $_TD
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> Adam Sj�gren wrote:
>> Enclosed is a tiny patch for plperl that puts the schema-name of the
>> current table in $_TD, so triggers can access tables using
>> schemaname.tablename, for instance like so:

> This seems like a good idea, but we should probably make analogous
> changes for plpgsql, pltcl and plpython. Having different trigger data
> available in some of these doesn't seem like a good idea.

Yeah.  I'm also a little disturbed by using "nspname" which is an
entirely internal name; plus it's a bit unclear *which* schema it's
supposed to be.  (One might think it's the schema the trigger function
is in, for instance.)  Somebody established a bad precedent by using
"relname" for the table name.

Maybe we should use field names like "table_name" and "table_schema".
"relname" could be kept around for awhile but deprecated as a duplicate
of "table_name".

Or if that seems too messy, keep "relname" but use "relschema" as the
new field.

            regards, tom lane

pgsql-patches by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Allow commenting of variables in postgresql.conf to
Next
From: Joachim Wieland
Date:
Subject: Re: Allow commenting of variables in postgresql.conf to