create table inside a transaction

Поиск
Список
Период
Сортировка
От Tim McAuley
Тема create table inside a transaction
Дата
Msg-id 3F784154.1010503@tcd.ie
обсуждение исходный текст
Ответы Re: create table inside a transaction
Список pgsql-jdbc
Hi,

I am testing out Postgresql 7.4 beta3 (with appropriate jdbc driver) and
have come across an interesting little problem.

According to some comments on the web, statements such as "CREATE TABLE"
should not be run within a transaction. However, it is this very
statement that I am running from an sql ant task and I get the following
error:

BUILD FAILED
build.xml:257: org.postgresql.util.PSQLException: ERROR: CREATE DATABASE
cannot run inside a transaction block

Any ideas how to overcome this? My thoughts are:

- This message has obviously been upgraded to through an error in 7.4
- The sql call in the ant task is not in a <transaction> element.
    - however, ant will still place all the sql code in a single
transaction.

To overcome this I think the options are:
1 Modify ant code so that an sql ant task can be called without using a
transaction at all.
2 Ensure postgresql does not through this as an error (or the jdbc driver?)
3 Create own code (or ant task) that can run sql commands without using
transactions.

Just wondering what other people have done and what may be seen as the
best solution. Personally I would like if Ant had the option to disable
transactions altogether. This would seem the neatest and most "correct"
option.

All the best,

Tim


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Stuart M Easterling"
Дата:
Сообщение: Re: problem with setting boolean value on
Следующее
От: Nicholas Rahn
Дата:
Сообщение: Re: create table inside a transaction