current_timestamp after queries

From: Guido Staub <staub(at)gik(dot)uni-karlsruhe(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: current_timestamp after queries
Date: 2002-09-30 09:44:17
Message-ID: 3D981CF1.BBFC907C@gik.uni-karlsruhe.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Witney 2002-09-30 09:48:19 Re: Beta2 - A Late Announcement
Previous Message Tom Lane 2002-09-30 04:36:34 Re: [SQL] CURRENT_TIMESTAMP

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-09-30 09:55:26 Re: current_timestamp after queries
Previous Message Steve King 2002-09-30 08:14:00 Bad rules