From: | Mark Kirkwood <markir(at)paradise(dot)net(dot)nz> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Mike Mascari <mascarm(at)mascari(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Yury Bokhoncovich <byg(at)center-f1(dot)ru>, Dan Langille <dan(at)langille(dot)org>, Roland Roberts <roland(at)astrofoto(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: (Fwd) Re: Any Oracle 9 users? A test please... |
Date: | 2002-10-03 07:56:47 |
Message-ID: | 3D9BF83F.8030802@paradise.net.nz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
>
>
>Has anyone done the corresponding experiments on the other DBMSes to
>identify exactly when they allow CURRENT_TIMESTAMP to advance ?
>
I have Db2 on hand and examined CURRENT TIMESTAMP in an sql procedure.
(IBM have implemented it without the "_" ....)
The short of it is that CURRENT TIMESTAMP is the not frozen to the
transaction start,
but reflects time movement within the transaction.
Note that "db2 +c" is equivalent to issueing BEGIN in Pg,
and the command line tool (db2) keeps (the same) connection open until
the TERMINATE is issued :
$ cat stamp.sql
create procedure stamp()
language sql
begin
insert into test values(1,current timestamp);
insert into test values(2,current timestamp);
insert into test values(3,current timestamp);
insert into test values(4,current timestamp);
insert into test values(5,current timestamp);
insert into test values(6,current timestamp);
insert into test values(7,current timestamp);
insert into test values(8,current timestamp);
insert into test values(9,current timestamp);
end
@
$ db2 connect to dss
Database Connection Information
Database server = DB2/LINUX 7.2.3
SQL authorization ID = DB2
Local database alias = DSS
$ db2 -td@ -f stamp.sql
DB20000I The SQL command completed successfully.
$ db2 +c
db2 => call stamp();
"STAMP" RETURN_STATUS: "0"
db2 => commit;
DB20000I The SQL command completed successfully.
db2 => select * from test;
ID VAL
----------- --------------------------
1 2002-10-03-19.35.16.286019
2 2002-10-03-19.35.16.286903
3 2002-10-03-19.35.16.287549
4 2002-10-03-19.35.16.288235
5 2002-10-03-19.35.16.288925
6 2002-10-03-19.35.16.289571
7 2002-10-03-19.35.16.290209
8 2002-10-03-19.35.16.290884
9 2002-10-03-19.35.16.291522
9 record(s) selected.
db2 => terminate;
regards
Mark
From | Date | Subject | |
---|---|---|---|
Next Message | Mario Weilguni | 2002-10-03 08:56:10 | Re: (Fwd) Re: Any Oracle 9 users? A test please... |
Previous Message | Dave Page | 2002-10-03 07:47:07 | Re: [HACKERS] psqlODBC *nix Makefile (new 7.3 open item?) |