Re: [HACKERS] current_timestamp after queries

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Greg Copeland <greg(at)copelandconsulting(dot)net>
Cc: Guido Staub <staub(at)gik(dot)uni-karlsruhe(dot)de>, PostgresSQL General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] current_timestamp after queries
Date: 2002-09-30 15:17:09
Message-ID: 200209301517.g8UFH9216111@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Greg Copeland wrote:
-- Start of PGP signed section.
> Is this because of time stamp caching and/or transaction coherency
> issues?

It is because we thought that is what the standard required; now we are
not sure.

>
> Greg
>
>
> On Mon, 2002-09-30 at 10:02, Bruce Momjian wrote:
> >
> > CURRENT_TIMESTAMP returns the time of the transaction start, not the
> > statement start. We are currently discussing on hackers whether this is
> > correct or not. We don't currently allow you to access the statement
> > start time. Sorry.
> >
> > ---------------------------------------------------------------------------
> >
> > Guido Staub wrote:
> > > Hi all,
> > > I'm trying the following:
> > > BEGIN;
> > > select current_timestamp into mytable;
> > > .
> > > some queries
> > > .
> > > insert current timestamp into mytable;
> > > COMMIT;
> > > When I call this with the \i <filename> command, all is working fine,
> > > but the two current_timestamp entries are the same, there is no
> > > difference between them but there should. So I've tried:
> > > BEGIN;
> > > select current_timestamp into mytable;
> > > .
> > > some queries
> > > .
> > > COMMIT;
> > > BEGIN;
> > > insert current_timestamp into mytable;
> > > COMMIT;
> > > and now the entries are different.
> > > I think that the accuracy is not good enough because I've started two
> > > BEGIN statements and some time is elapsing between them. Am I right?
> > > Or does anybody know a better solution to store the elapsed time after
> > > some queries without writing some code in C or JAVA?
> > >
> > > Thanks in advance
> > > Guido Staub
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania 19073
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
-- End of PGP section, PGP failed!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-30 15:29:59 Re: current_timestamp after queries
Previous Message Bruno Wolff III 2002-09-30 15:12:57 Re: LIMIT: does it cause the query to find all matching sets first?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-09-30 15:18:27 7.2.3 fixes (was Re: Cause of missing pg_clog files)
Previous Message Greg Copeland 2002-09-30 15:10:09 Re: [HACKERS] current_timestamp after queries