X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 8E4AB30FE46 for ; Tue, 1 Jul 2003 10:11:12 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 34325-02 for ; Tue, 1 Jul 2003 07:11:02 -0300 (ADT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id BF1F2310C1C for ; Tue, 1 Jul 2003 07:11:01 -0300 (ADT) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19XI5d-0005gc-00 for ; Tue, 01 Jul 2003 12:10:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19XHua-0004mt-00 for ; Tue, 01 Jul 2003 11:58:56 +0200 From: Troels Arvin Subject: Immutable attributes? Date: Tue, 01 Jul 2003 11:59:24 +0200 Lines: 23 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@main.gmane.org User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) X-Archive-Number: 200307/6 X-Sequence-Number: 14120 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