Re: Referencing any field in a trigger - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Referencing any field in a trigger
Date
Msg-id 20070525160050.GB11176@alvh.no-ip.org
Whole thread Raw
In response to Referencing any field in a trigger  (Robert Fitzpatrick <lists@webtent.net>)
Responses Re: Referencing any field in a trigger
List pgsql-general
Robert Fitzpatrick wrote:
> How can I reference any NEW field in an insert/update trigger function?
> When someone inserts or updates any field with a single asterisk (*), I
> need it to become '%%%'. But if they use an asterisk in any combination
> with other fields, then I want to TRANSLATE those asterisks to a single
> '%'.

You can't do that with PL/pgSQL.  You can with other languages like
PL/Perl though (which has better tools for string treatment, so it is a
good idea anyway).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Robert Fitzpatrick
Date:
Subject: Re: Referencing any field in a trigger
Next
From: Joseph Shraibman
Date:
Subject: Re: swap storm created by 8.2.3