Re: trouble with triggers - Mailing list pgsql-general

From Fran Fabrizio
Subject Re: trouble with triggers
Date
Msg-id 3B54562A.D31A3B79@mmrd.com
Whole thread Raw
In response to trouble with triggers  ("Robert Treat" <robertt@auctionsolutions.com>)
Responses RE: trouble with triggers  ("Robert Treat" <robertt@auctionsolutions.com>)
List pgsql-general
>
> CREATE TRIGGER formatname BEFORE update OR insert ON mytable FOR EACH row
> EXECUTE PROCEDURE lower(name);

The way I understand it, you can't just use any function as a trigger.  It has
to have a return type of opaque.  I see that you are basically trying to
convert to lowercase before inserting, but I'm pretty sure you'd have to define
your own pgplsql function for the trigger which uses the special variable 'new'
to access the incoming row.  Your function can call lower() of course.

Others here can probably give you more details.

-Fran




pgsql-general by date:

Previous
From: ryan.a.roemmich@mail.sprint.com
Date:
Subject: RE: Postmaster won't start.
Next
From: Ryan Mahoney
Date:
Subject: Re: How to find out the weekday from a date???