| From: | Troels Arvin <troels(at)arvin(dot)dk> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Immutable attributes? |
| Date: | 2003-07-01 09:59:24 |
| Message-ID: | pan.2003.07.01.09.59.23.580853@arvin.dk |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Hello,
I have a table like this:
create table test (
"test_id" serial primary key,
"created" timestamp with time zone
default current_timestamp
check(created = current_timestamp),
"some_datum" int not null
);
My question concerns the "created" attribute: I want this to reflect when
the tuple was craeated; and I want to make sure that the timestamp is not
wrong. That will work with the above schema. However, I also want to make
sure that the "crated" attribut for a tuple is not changed once it has
been set.
I'm thinking about implementing it through a trigger, but is there a
better way to create such "immutable" attributes?
/Troels
| From | Date | Subject | |
|---|---|---|---|
| Next Message | kevin rowe | 2003-07-01 11:12:16 | mergejoin error message executing in 7.2 |
| Previous Message | Alon Noy | 2003-07-01 09:01:22 | passing a record as a function argument in pl/pgsql |