Re: define transaction within pg/psql. Necessary? - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject Re: define transaction within pg/psql. Necessary?
Date
Msg-id 2f4958ff1002180206v1e3c3f49q81c548c7ed1c91cb@mail.gmail.com
Whole thread Raw
In response to define transaction within pg/psql. Necessary?  (Antonio Goméz Soto<antonio.gomez.soto@gmail.com>)
List pgsql-general
all statements in postgresql are self contained transactions, and you cannot change that.
To answer your question directly, you don't have to, it will all be a transaction.

The best example of that is to run following query in psql:

CREATE TEMP TABLE foo() ON COMMIT DROP;


the table will not exists anymore after running it. Precisely because it was 'automatically' wrapped in begin/commit, and dropped at the end of it.


hth

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Define permissions at database level
Next
From: Richard Huxton
Date:
Subject: Re: define transaction within pg/psql. Necessary?