Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs

From: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
To: Hannu <hannu(at)trust(dot)ee>
Cc: Byron Nikolaidis <byronn(at)insightdist(dot)com>, interfaces postgres <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Date: 1998-06-11 11:41:24
Message-ID: Pine.LNX.3.96.980611112320.3708A-100000@proxy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-sql

On Thu, 11 Jun 1998, Hannu wrote:

> Byron Nikolaidis wrote:
> >
> > 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?
>
> Why not use the system column tmin for this purpose?
>
> hannu=> create table test(i int);
> CREATE
> hannu=> insert into test values(5);
> INSERT 17454 1
> hannu=> select tmin,tmax,i from test;
> tmin |tmax |i
> -----------------------------+-------+-
> Thu Jun 11 11:12:17 1998 EEST|current|5
> (1 row)
>
> hannu=> update test set i=2;
> UPDATE 1
> hannu=> select tmin,tmax,i from test;
> tmin |tmax |i
> -----------------------------+-------+-
> Thu Jun 11 11:13:00 1998 EEST|current|2
> (1 row)
>
> ------
> Hannu
>
One minute! what's that tmin?
What version do you have?
I have v6.3.2 and it doesn't know tmin.

prova=> create table test(i int);
CREATE
prova=> insert into test values(5);
INSERT 15650 1
prova=> select tmin,tmax,i from test;
ERROR: attribute 'tmin' not found
Jose'

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Byron Nikolaidis 1998-06-11 15:53:07 Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Previous Message Jose' Soares Da Silva 1998-06-11 10:15:56 Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs

Browse pgsql-sql by date

  From Date Subject
Next Message Lendvary Gyorgy 1998-06-11 13:26:57 update by one transaction
Previous Message Jose' Soares Da Silva 1998-06-11 10:52:59 Re: [SQL] Order by birthdate