From: | Lincoln Yeoh <lylyeoh(at)mecomb(dot)com> |
---|---|
To: | general <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] TRANSACTIONS |
Date: | 2000-02-23 03:50:26 |
Message-ID: | 3.0.5.32.20000223115026.008b2b90@pop.mecomb.po.my |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
At 12:47 PM 22-02-2000 +0100, Jose Soares wrote:
>begin transaction;
>create table tmp(a int);
>insert into tmp values (1);
>insert into tmp values (1000000000000000000000000000000000);
>ERROR: pg_atoi: error reading "1000000000000000000000000000000000":
>Numerical result out of range
>commit;
>select * from tmp;
>ERROR: tmp: Table does not exist.
>-------------------------------------------------------
>Interbase, Oracle,Informix,Solid,Ms-Access,DB2:
>-------------------------------------------------------
>connect hygea.gdb;
>create table temp(a int);
>insert into temp values (1);
>insert into temp values (1000000000000000000000000000000000);
>commit;
>select * from temp;
>
>arithmetic exception, numeric overflow, or string truncation
>
> A
>===========
> 1
Stuff done in a transaction cannot be committed if there is an error. So
looks like Postgres is right and the rest are wrong ;).
Also I believe Oracle does a commit behind your back whenever you do a
create table or stuff like that.
However I did have problems rolling back a create table in Postgres before-
after rolling back I could not recreate a table of the same name. I had to
manually unlink the table at filesystem level. Not sure if that has been
fixed.
On a different note I wonder if there could be layers of transactions
(without having to create two separate connections)..
Begin transaction A
Try to do transaction B
Depending on whether B succeeds or fails we do the following stuff differently
blahblahblah
If blahblablah fails then rollback the whole thingy, including nested
transaction B (even if "committed")
commit transaction A
Sounds like a headache to implement tho (performance hits etc), and
probably more an academic feature than anything. So I'm just wondering just
for the sake of wondering ;). If we go that way lots of people will have a
new toy to play with (to sell as well) and things will get even more
complex.. <grin>.
Cheerio,
Link.
From | Date | Subject | |
---|---|---|---|
Next Message | Lincoln Yeoh | 2000-02-23 03:57:37 | Re: [GENERAL] Calender |
Previous Message | Dustin Sallings | 2000-02-23 03:14:16 | Re: [GENERAL] Re: [General] pgsql on win95 |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-02-23 05:12:31 | Re: [HACKERS] Numeric with '-' |
Previous Message | Bruce Momjian | 2000-02-23 01:30:18 | Re: [HACKERS] Beta for 4:30AST ... ? |