Read-only attributes - Mailing list pgsql-novice

From Michael Klatt
Subject Read-only attributes
Date
Msg-id NCBBLFLGLEIDHCJLONHNMEGJFHAA.mdklatt@ou.edu
Whole thread Raw
Responses Re: Read-only attributes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
I have a table where one of the attributes is the time a row was inserted:
'updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP'.

Is there a way to define this attribute so that a user cannot override the
default value?  I have tried this constraint, but it fails for any INSERT:
'updated ... CHECK (updated = CURRENT_TIMESTAMP)'.

___________________________________
Michael Klatt

University of Oklahoma
Environmental Verification and Analysis Center
710 Asp Avenue, Suite 8
Norman, OK  73069

405.447.8412
405.447.8455  FAX
http://www.evac.ou.edu/

"I'm a great motivator.  Everyone says they have to work twice as hard when
I'm around."




pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump - groups and users.
Next
From: Michael Klatt
Date:
Subject: Ignore values on INSERT