From: Dmitry Fefelov on
> How can a pl/pgsql trigger change the
> values of dynamic fields in NEW record ?
>
> By "dynamic" I mean that the field name
> is a variable in the trigger context.

It's not possible in plpgsql, but you can write plperl function, and later use
it in plpgsql triggers.

Regards,
Dmitry

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: strk on
On Wed, Mar 10, 2010 at 07:50:16AM -0500, Andrew Dunstan wrote:

> Using an hstore in 9.0 it's not too bad,

Does it still have a limit of 65535 bytes per field ?

--strk;

() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: David Fetter on
On Thu, Mar 11, 2010 at 03:27:23PM +0100, strk wrote:
> On Wed, Mar 10, 2010 at 07:50:16AM -0500, Andrew Dunstan wrote:
>
> > Using an hstore in 9.0 it's not too bad,
>
> Does it still have a limit of 65535 bytes per field ?

No. :)

Cheers,
David.
--
David Fetter <david(a)fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter(a)gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Merlin Moncure on
On Wed, Mar 10, 2010 at 7:50 AM, Andrew Dunstan <andrew(a)dunslane.net> wrote:
>>> 2010/3/9 strk <strk(a)keybit.net>:
>>>> How can a pl/pgsql trigger change the
>>>> values of dynamic fields in NEW record ?
>>>>
>>>> By "dynamic" I mean that the field name
>>>> is a variable in the trigger context.
>>>>
>>>> I've been told it's easy to do with pl/perl but
>>>> I'd like to delive a pl/pgsql solution to have
>>>> less dependencies.
>
> Using an hstore in 9.0 it's not too bad, Try something like:
>

Agree 100%. The new hstore going to completely nail a broad class of
issues that have historically been awkward in plpgsql functions.
(small aside: the other biggie would be able to push a composite type
in to an update statement...something like 'update foo set foo =
new'). This is really great...some variant of this question is
continually asked it seems.

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Alvaro Herrera on
Merlin Moncure escribi�:


> (small aside: the other biggie would be able to push a composite type
> in to an update statement...something like 'update foo set foo =
> new'). This is really great...some variant of this question is
> continually asked it seems.

Can't you already do that with EXECUTE ... USING NEW? hmm, ah, but you
have to specify the columns in NEW, so it doesn't really work for you,
does it?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers