dbTalk Databases Forums  

[BUGS] BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gerhard Lutz
 
Posts: n/a

Default [BUGS] BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF - 02-16-2006 , 08:49 AM







The following bug has been logged online:

Bug reference: 2265
Logged by: Gerhard Lutz
Email address: gerhard.lutz (AT) mbtech-group (DOT) com
PostgreSQL version: 8.1.3
Operating system: Windows XP SP2
Description: CREATE TABLE when AUTOCOMMIT is OFF
Details:

I want to upgrade my PostgreSQL server from 8.0.4 to 8.1.3.
My application connects to the database via ODBC.
After connecting to the database I set the AUTOCOMMIT mode to OFF.

::SQLSetConnectAttr(g_hDBConnection, SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER)SQL_AUTOCOMMIT_OFF), 0);

Now, if I want do create a table via ODBC, e.g.

"CREATE TABLE db_version ( hv integer, uv integer, nv integer, r integer,
rel integer)"

, I get the error message

"Error while executing the query;
ERROR: current transaction is aborted, commands ignored until end of
transaction block (7)"

In PostgreSQL 8.0.4 I was able to create a table in AUTOCOMMIT mode OFF
without any error. Is this a bug in 8.1.3?

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF - 02-16-2006 , 12:14 PM






On Thu, Feb 16, 2006 at 01:21:18PM +0000, Gerhard Lutz wrote:
Quote:
"Error while executing the query;
ERROR: current transaction is aborted, commands ignored until end of
transaction block (7)"
Some previous command failed so no more commands in this transaction
will be allowed. If you don't know what command failed then you
could configure query logging.

Quote:
In PostgreSQL 8.0.4 I was able to create a table in AUTOCOMMIT mode OFF
without any error. Is this a bug in 8.1.3?
The error is apparently happening before the CREATE TABLE command.
Let's see what earlier command failed and why.

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #3  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF - 02-17-2006 , 11:46 AM



Please copy the pgsql-bugs mailing list on replies. Also, if you've
submitted multiple bug reports then please keep the discussion of
each bug in their respective threads. I'm replying only to 2265
because I'm not as familiar with the other problems.

On Fri, Feb 17, 2006 at 03:09:48PM +0100, Gerhard.Lutz (AT) mbtech-group (DOT) com wrote:
Quote:
Now I configured query logging and I saw what was wrong.
First I executed

SELECT rel FROM versions

but the 'versions' table didn't exist. So I thought that I can create this
'versions' table in the
same transaction. In PostgreSQL 8.0.4 this worked, but in 8.1.3 I got the
error message.
When you say that "this" worked in 8.0.4 but not in 8.1.3, what
exactly do you mean by "this"? If the SELECT failed then any
subsequent command in the same transaction should also have failed;
8.0 and 8.1 shouldn't differ in that respect, at least not in the
backend. If you can demonstrate otherwise then please post a
repeatable test case (i.e., a set of SQL statements that can be run
against an empty database in a new session or a new transaction).
Try running tests with psql as well as with ODBC to see if they
behave differently.

Quote:
When executing COMMIT after the SELECT statement, I was able to do the
CREATE TABLE.
I think that this behaviour is desired in 8.1.3, am I right? It surely has
to do with the two-phase commit.
Are you using two-phase commit? Why do you think it's "surely"
involved? Let's see a complete test case before jumping to
conclusions.

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.