Re: Re: Query precompilation?

Dominic J. Eidson <sauron@the-infinite.org>

From: "Dominic J. Eidson" <sauron@the-infinite.org>
To: Mario Weilguni <mweilguni@sime.com>
Cc: pgsql-general@postgresql.org
Date: 2001-02-27T21:56:47Z
Lists: pgsql-hackers
On Tue, 27 Feb 2001, Mario Weilguni wrote:

> Thanks for the answer, but that's not disabling autocommit, it committing by 
> hand. What I mean ist Oracle-behaviour --> everthing is a transaction and 
> must be commited by "COMMIT". What I ment was something like "SET autocommit 
> to OFF" or something like this.

Everything _is_ a transaction - the BEGIN ... COMMIT is implied, if you
don't wrap your SQL statements in BEGIN ... COMMIT.

Compare:

dominic=# INSERT INTO pages ( page_from, page_to, page_data ) VALUES ( 'Dominic', '555-1212', 'This is a test page');
INSERT 945129 1

[ This was one transaction ]
dominic=# SELECT count(*) FROM pages;
 count 
-------
     1
(1 row)

[ This was the second transaction ]

... for a total of two transactions, as opposed to:

dominic=# BEGIN;
BEGIN
dominic=# INSERT INTO pages ( page_from, page_to, page_data ) VALUES ( 'Dominic', '555-1212', 'Test page number two.' );
INSERT 945130 1
dominic=# SELECT count(*) FROM pages;
 count 
-------
     2
(1 row)

dominic=# COMMIT;
COMMIT

[ This was just _one_ transaction ]


-- 
Dominic J. Eidson
                                        "Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/              http://www.the-infinite.org/~dominic/