On Sat, Aug 28, 2010 at 6:23 PM, FabrÃzio de Royes Mello
wrote:
> 2010/8/28 Dmitriy Igrishin
>>
>> Hey Michael,
>>
>> As of PostgreSQL 9.0 you can do it from PL/pgSQL by
>> using hstore module
>> (http://www.postgresql.org/docs/9.0/static/hstore.html)
>>
>> I wrote an example for you:
>>
>>
>>
>
2010/8/28 Dmitriy Igrishin
> Hey Michael,
>
> As of PostgreSQL 9.0 you can do it from PL/pgSQL by
> using hstore module
> (http://www.postgresql.org/docs/9.0/static/hstore.html)
>
> I wrote an example for you:
>
>
>
>
Another way to do that is create a temp table from NEW or OLD record and
loop
Hey Michael,
As of PostgreSQL 9.0 you can do it from PL/pgSQL by
using hstore module
(http://www.postgresql.org/docs/9.0/static/hstore.html)
I wrote an example for you:
CREATE TABLE person(id integer, fname text, lname text, birthday date);
CREATE TRIGGER person_test_trigger BEFORE INSERT
ON
On Thu, Aug 26, 2010 at 12:59 PM, Michael P. Soulier
wrote:
> On 26/08/10 Tom Lane did say:
>
>> If you're trying to do this in plpgsql, the answer is you can't.
>> plpgsql doesn't support dynamic field references, which is what you'd
>> need for what (I think) you're trying to do.
>>
>> You can d
On 26/08/10 Tom Lane did say:
> If you're trying to do this in plpgsql, the answer is you can't.
> plpgsql doesn't support dynamic field references, which is what you'd
> need for what (I think) you're trying to do.
>
> You can do it in pltcl or plperl, and probably also plpython though
> I don't
"Michael P. Soulier" writes:
> I'm very new to writing postgres procedures, and I'm trying to loop over
> the fields in the NEW and OLD variables available in an after trigger,
> and I can't quite get the syntax correct.
If you're trying to do this in plpgsql, the answer is you can't.
plpgsql do