Re: function attributes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(dot)dunstan(at)pgexperts(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: function attributes
Date: 2010-12-12 15:43:16
Message-ID: 4031.1292168596@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(dot)dunstan(at)pgexperts(dot)com> writes:
> Yesterday I did a bit of work on allowing bytea values to be passed into
> and out of plperl in binary format, effectively removing the need to
> escape and de-escape them. (The work can be seen on he plperlargs branch
> of my development repo at
> <https://github.com/adunstan/postgresql-dev/commits/plperlargs/>).

> At the moment the behaviour is triggered by a custom setting
> (plperl.pass_binary_bytea), but this isn't really satisfactory. We could
> turn it on permanently, but that would break a lot of legacy code. What
> we really need is a way of marking a function with some attributes. Of
> course, we could put it in the program text like plpgsql's
> #variable_conflict, but that's really rather ugly. The grammar already
> has an attribute mechanism for functions, and ISTM we just need to
> extend that a bit to allow setting of function attributes reasonably
> flexibly, much as we can now specify format options on EXPLAIN or we'll
> soon be able to specify options for foreign tables.

I do not want to go there. What you're proposing will soon turn into a
real mess, with arbitrary language-specific junk tagged onto pg_proc
entries. And what's worse, it'll be mixed with non-language-specific
junk, because of the existing legacy WITH entries.

Tim Bunce seemed to think that this particular problem might be solvable
in a completely transparent way, by having byteas convert into Perl
objects that have a hook for producing a backwards-compatible text
translation. Have you looked into that idea?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2010-12-12 15:51:36 Re: proposal : cross-column stats
Previous Message Heikki Linnakangas 2010-12-12 14:43:00 Re: proposal : cross-column stats