Re: [GENERAL] Date & Time

From: Ed Loehr <ELOEHR(at)austin(dot)rr(dot)com>
To: kaiq(at)realtyideas(dot)com
Cc: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>, Dale Anderson <danderso(at)crystalsugar(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Date & Time
Date: 1999-12-01 00:10:09
Message-ID: 38446761.D2D62AAF@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just curious: anyone have any comment on any practical differences between now() and CURRENT_TIMESTAMP, which seems to work
the same?

Cheers.
Ed Loehr

kaiq(at)realtyideas(dot)com wrote:

> "now" performs better in this case:
> insert into test values (123, 'now','Name');
>
> now() is needed for "default" in create table, because
> "now" won't work right (a bug/feature ?).
>
> see archive in this list
>
> On Tue, 30 Nov 1999, Ross J. Reedstrom wrote:
>
> > Dale -
> > How about this?
> >
> > Ross
> >
> > test=> create table test (t_id int, start datetime, what text);
> > CREATE
> > test=> insert into test values (123, now(), 'Name');
> > INSERT 684299 1
> > test=> select * from test;
> > t_id|start |what
> > ----+----------------------------+----
> > 123|Tue Nov 30 16:46:07 1999 CST|Name
> > (1 row)
> >
> > test=> insert into test values (456, now(), 'Other');
> > INSERT 684300 1
> > test=> select * from test;
> > t_id|start |what
> > ----+----------------------------+----
> > 123|Tue Nov 30 16:46:07 1999 CST|Name
> > 456|Tue Nov 30 16:46:15 1999 CST|Other
> > (2 rows)
> >
> > test=>
> >
> > --
> > Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
> > NSBRI Research Scientist/Programmer
> > Computer and Information Technology Institute
> > Rice University, 6100 S. Main St., Houston, TX 77005
> >
> >
> >
> > On Tue, Nov 30, 1999 at 04:34:34PM -0600, Dale Anderson wrote:
> > > How would I insert the current date & time into a record during an insert, IE such as the Oracle SYSDATE function??
> > >
> > > ( insert into test values (123, SYSDATE, 'Name');
> > >
> > > Thanks,
> > > Dale.
> > >
> > >
> > >
> > > ************
> > >
> >
> > ************
> >
>
> ************

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-12-01 00:27:46 Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"
Previous Message Ed Loehr 1999-12-01 00:06:27 Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"