Re: Referencing any field in a trigger

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Fitzpatrick <lists(at)webtent(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Referencing any field in a trigger
Date: 2007-05-25 17:45:20
Message-ID: 20070525174520.GC15294@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Robert Fitzpatrick wrote:

> But still, how would I reference all fields using the pl/perl? Can I
> specify column numbers versus names as in '$_TD->{new}{1}' for the first
> column and loop or something? For instance, I would like to be able to
> say if any NEW column has a single asterisk only, set it to '%%%'.

Well, do a foreach ($_TD->{new}) or foreach (keys $_TD->{new}) (not sure
of the exact syntax but if you're used to Perl you can figure it out).

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arnaldo Gandol 2007-05-25 17:56:19 2 instance of postgres service running against same db files?
Previous Message Robert Fitzpatrick 2007-05-25 17:31:40 Re: Referencing any field in a trigger