Re: Read-only column - Mailing list pgsql-general

From Claudio Succa
Subject Re: Read-only column
Date
Msg-id 1071336322.696.28.camel@master.to1.pertel.it
Whole thread Raw
In response to Re: Read-only column  (Chris Travers <chris@travelamericas.com>)
List pgsql-general
Il sab, 2003-12-13 alle 15:48, Chris Travers ha scritto:
> Or, depending if you just want to ignore updates to that field (not
> always best, but possible, similar to a view).
>
> CREATE OR REPLACE FUNCTION block_col()
> RETURNS TRIGGER AS '
>     BEGIN
>         NEW.ts_field := OLD.ts_field;
>         RETURN NEW;
>     END;
> ' LANGUAGE PLPGSQL;
>

Great. It works exactly as I need.

(notice: I had to replace RETURNS TRIGGER with RETURNS OPAQUE)

Thanks everybody,
Claudio


--
Claudio Succa
PERTEL - Torino - Italy
+39-011-437.4141
http://www.pertel.it
http://www.uniassist.it



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Why is postgres an ORDMS
Next
From: Joel Rodrigues
Date:
Subject: Re: make error Mac OS X (ar: illegal option -- s)