Re: Defaulting a column to 'now' - Mailing list pgsql-sql

From Bricklen Anderson
Subject Re: Defaulting a column to 'now'
Date
Msg-id 43A0612C.2010605@presinet.com
Whole thread Raw
In response to Defaulting a column to 'now'  ("Ken Winter" <ken@sunward.org>)
List pgsql-sql
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()...


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Defaulting a column to 'now'
Next
From: "Keith Worthington"
Date:
Subject: Re: Defaulting a column to 'now'