Re: [GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-09 Thread Pavel Stehule
Hello plpgsql isn't good tool for this. use a plperl or plpython instead. your solution is extremly slow. Regards Pavel Stehule 2010/9/9 Nick nboutel...@gmail.com: I need to dynamically update NEW columns. Ive been inserting the NEW values into a temp table, updating them, then passing the

Re: [GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-09 Thread Dmitriy Igrishin
Hey Nick, You may do it with PL/pgSQL more easily with hstore module. Please, refer to http://www.postgresql.org/docs/9.0/static/hstore.html Please, look at the hstore(record) and populate_record(record, hstore) function. Hope this helps. And I think it will be more faster then you solution.

Re: [GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-09 Thread Nick
On Sep 9, 2:21 am, dmit...@gmail.com (Dmitriy Igrishin) wrote: Hey Nick, You may do it with PL/pgSQL more easily with hstore module. Please, refer tohttp://www.postgresql.org/docs/9.0/static/hstore.html Please, look at the hstore(record) and populate_record(record, hstore) function. Hope

Re: [GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-09 Thread Merlin Moncure
On Thu, Sep 9, 2010 at 6:34 PM, Nick nboutel...@gmail.com wrote: On Sep 9, 2:21 am, dmit...@gmail.com (Dmitriy Igrishin) wrote: Hey Nick, You may do it with PL/pgSQL more easily with hstore module. Please, refer tohttp://www.postgresql.org/docs/9.0/static/hstore.html Please, look at the

[GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-08 Thread Nick
I need to dynamically update NEW columns. Ive been inserting the NEW values into a temp table, updating them, then passing the temp table values back to NEW (is there a better way?). Ive had success with this method unless there is a null value... EXECUTE 'CREATE TEMP TABLE new AS SELECT $1.*'