Re: Read-only column

From: Claudio Succa <claudio(dot)succa(dot)ml(at)pertel(dot)it>
To: Chris Travers <chris(at)travelamericas(dot)com>
Cc: Doug McNaught <doug(at)mcnaught(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Read-only column
Date: 2003-12-13 17:25:22
Message-ID: 1071336322.696.28.camel@master.to1.pertel.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joel Rodrigues 2003-12-13 17:28:00 Re: make error Mac OS X (ar: illegal option -- s)
Previous Message Miso Hlavac 2003-12-13 16:57:17 Change date format only for one DB

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2003-12-13 20:58:59 Re: WITH clause
Previous Message Bruce Momjian 2003-12-13 15:46:06 Re: fork/exec patch