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 16:00:50
Message-ID: 20070525160050.GB11176@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joseph Shraibman 2007-05-25 16:20:38 Re: swap storm created by 8.2.3
Previous Message Robert Fitzpatrick 2007-05-25 15:53:44 Re: Referencing any field in a trigger