Re: trouble with triggers

From: Fran Fabrizio <ffabrizio(at)mmrd(dot)com>
To: Robert Treat <robertt(at)auctionsolutions(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trouble with triggers
Date: 2001-07-17 15:13:46
Message-ID: 3B54562A.D31A3B79@mmrd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jose Manuel Lorenzo Lopez 2001-07-17 15:15:57 Re: How to find out the weekday from a date???
Previous Message Tom Lane 2001-07-17 15:11:33 Re: Partial Indices vs. mixing columns and functions