pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Petter Reinholdtsen <pere@td.org.uit.no>
To: pgsql-sql@postgresql.org
Subject: Problems with default date 'now'
Date: Tue, 9 Jun 1998 18:19:49 +0200
Message-ID: <199806091619.SAA10905@sleeper.games.no> (raw)


I have a table where I want the default value of a date field to be
todays date when I do insert.  I have this table definition:

CREATE TABLE testdate(
	received date DEFAULT 'now',
	info text NOT NULL
	);

The problem is that the 'now' apparently is substituted when I create
the table, not when I insert into it.  Is there another way to handle
this?  This is on Linux RedHat 5.0 with PostgreSQL 6.2.1.

Please remember to send replies to me (too), as I am not member on
this mailing-list.

Happy hacking,
-- 
##>  Petter Reinholdtsen <##    | pere@td.org.uit.no
 O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
http://www.hungry.com/~pere/    | Go Mozilla, go! Go!




view thread (7+ messages)  latest in thread

Message-ID: <199806091619.SAA10905@sleeper.games.no>
Permalink:  ../199806091619.SAA10905@sleeper.games.no/
Also on:    postgresql.org/message-id/199806091619.SAA10905@sleeper.games.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pere@td.org.uit.no
  Subject: Re: Problems with default date 'now'
  In-Reply-To: <199806091619.SAA10905@sleeper.games.no>
  References: <199806091619.SAA10905@sleeper.games.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox