Re: Timestamp with timezone with Default value

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Timestamp with timezone with Default value
Date: 2009-07-19 12:59:31
Message-ID: h3v5bj$q2t$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2009-07-18, Gianvito Pio <pio(dot)gianvito(at)gmail(dot)com> wrote:
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0017_01CA0791.49E30EB0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Hi all,
> how can I define a column of timestamp with timezone type...with a =
> default value?

Same as any other column with a default value.

If you're inserting NULL into the column the NULL will override the
default. Postgres does what you tell it.

If you want the default value use the keyword DEFAULT (in for the
value in that column) or don't mention that column. The DEFAULT
keyword also works with UPDATE.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message chester c young 2009-07-20 13:19:39 how to tell if column set on update
Previous Message Gianvito Pio 2009-07-18 17:09:31 Table inheritance problem