X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 08BB19DC87C for ; Wed, 14 Dec 2005 14:16:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46682-04 for ; Wed, 14 Dec 2005 14:16:27 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from presinet.com (presinet.com [209.53.156.1]) by postgresql.org (Postfix) with ESMTP id CEA039DC887 for ; Wed, 14 Dec 2005 14:16:25 -0400 (AST) Received: from [10.10.1.151] ([10.10.1.151]) by presinet.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Dec 2005 10:12:10 -0800 Message-ID: <43A0612C.2010605@presinet.com> Date: Wed, 14 Dec 2005 10:15:08 -0800 From: Bricklen Anderson User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ken Winter CC: PostgreSQL pg-sql list Subject: Re: Defaulting a column to 'now' References: <003501c600d9$b799a1c0$6603a8c0@kenxp> In-Reply-To: <003501c600d9$b799a1c0$6603a8c0@kenxp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 14 Dec 2005 18:12:10.0937 (UTC) FILETIME=[E6F53290:01C600D9] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/123 X-Sequence-Number: 23665 Ken Winter wrote: > How can a column’s default be set to ‘now’, meaning ‘now’ as of when > each row is inserted? > > > > For example, here’s a snip of DDL: > > > > create table personal_data (… > > effective_date_and_time TIMESTAMP WITH TIME ZONE not null default 'now',… > try with now(), instead of now ... effective_date_and_time TIMESTAMPTZ not null default now()...