Re: declare column update expression

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Chris Velevitch <chris(dot)velevitch(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: declare column update expression
Date: 2008-09-15 07:46:48
Message-ID: 48CE12E8.8010505@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Velevitch wrote:
> On Thu, Sep 11, 2008 at 6:01 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> you should to use trigger
>
> I've never used trigger before, it looks messy and error prone having
> to write functions.

It is, but it's not really all that bad. If you like you can even write
a Pl/PgSQL function that (using EXECUTE) generates the required trigger
functions. Not pretty, but effective.

This would be an ideal case for column triggers that could be included
in DOMAIN types and/or set like column constraints in the table schema
definition. That doesn't seem to be on the cards for PostgreSQL in the
near to mid future, though.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris.Ellis 2008-09-15 08:52:27 Postgresql Text Search
Previous Message Peter Eisentraut 2008-09-15 06:52:11 Re: Statement level trigger clarification