Re: Read-only column

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Claudio Succa <claudio(dot)succa(dot)ml(at)pertel(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Read-only column
Date: 2003-12-13 15:24:16
Message-ID: 87d6asoi5b.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Claudio Succa <claudio(dot)succa(dot)ml(at)pertel(dot)it> writes:

> (Not to reinvent the wheel, do you know where I could find a suitable
> function to use in the trigger?)

No, but it should be pretty trivial to write. Just set up a BEFORE
UPDATE trigger that compares OLD.ts_field against NEW.ts_field and
does a RAISE ERROR if they're different. The PL/pgSQL docs have a few
decent examples of how to write a trigger function.

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message snpe 2003-12-13 15:27:09 7.5 features
Previous Message Claudio Succa 2003-12-13 15:19:57 Re: Read-only column

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-12-13 15:46:06 Re: fork/exec patch
Previous Message Claudio Succa 2003-12-13 15:19:57 Re: Read-only column