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

From Doug McNaught
Subject Re: Read-only column
Date
Msg-id 87d6asoi5b.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Re: Read-only column  (Claudio Succa <claudio.succa.ml@pertel.it>)
Responses Re: Read-only column  (Chris Travers <chris@travelamericas.com>)
List pgsql-general
Claudio Succa <claudio.succa.ml@pertel.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

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: [NOVICE] PostgreSQL Training
Next
From: Chris Travers
Date:
Subject: Re: Read-only column