pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Byron Nikolaidis <byronn@insightdist.com>
To: Krasnow, Greg <gak@hnc.com>
Cc: Jose' Soares Da Silva <sferac@bo.nettuno.it>
Cc: interfaces postgres <pgsql-interfaces@postgreSQL.org>
Cc: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Date: Wed, 10 Jun 1998 15:05:40 -0400
Message-ID: <357ED903.265DF2DA@insightdist.com> (raw)
References: <C162BB3549A5CF118D7400805FD4122401576EEE@pchnc.hnc.com>



Krasnow, Greg wrote:

> I haven't looked at DATETIME stuff, but does Postgres not have something
> similar to Oracle's SYSDATE?  In Oracle you can set an Oracle DATE column to
> have a default of SYSDATE.  This way Oracle can fill in the column at the
> time an insert is done.
>

Yes, you are right, and I noticed Jose' earlier mail about this on the 'sql'
list.

If you do:

create table x (a timestamp DEFAULT CURRENT_TIMESTAMP, b varchar);

It works AND it puts in the current time at INSERT of the new row.  (I noticed
if you use CURRENT_TIME instead, you get the time you created the table at, for
every row, which is not very useful.)

The only problem is that it doesn't change the value on an UPDATE!

Any thoughts?

Byron




view thread (27+ messages)  latest in thread

Message-ID: <357ED903.265DF2DA@insightdist.com>
Permalink:  ../357ED903.265DF2DA@insightdist.com/
Also on:    postgresql.org/message-id/357ED903.265DF2DA@insightdist.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: byronn@insightdist.com, gak@hnc.com, sferac@bo.nettuno.it, pgsql-sql@postgreSQL.org
  Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
  In-Reply-To: <357ED903.265DF2DA@insightdist.com>

* 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