Re: Transaction, Rollback and Database Corruption question, - Mailing list pgsql-general

From Tom Lane
Subject Re: Transaction, Rollback and Database Corruption question,
Date
Msg-id 5013.974851819@sss.pgh.pa.us
Whole thread Raw
In response to Transaction, Rollback and Database Corruption question,  (Joe Kislo <kislo@athenium.com>)
List pgsql-general
Joe Kislo <kislo@athenium.com> writes:
>     Well, I never issue a drop table.  I issue a CREATE TABLE, I issue some
> inserts.. then I TERMINATE the database connection.  Implicit rollback
> should uncreate the table and leave everything consistent.

Oh, wait, you're running 7.0.2 aren't you?  Update to 7.0.3, it'll get
better.  7.0.2 forgets to run the transaction-abort cleanup routine if
the client disconnects mid-transaction.  The database itself is fine,
but the action of deleting the no-longer-referenced table files doesn't
get done.

> If I terminate a large set of create
> tables and inserts in the middle.. and I try again, I get this error
> spewing from the server:

> FATAL 1:  my bits moved right off the end of the world!
>     Recreate index pg_attribute_relid_attnam_index.

We've heard sporadic reports of this, but I've never been able to
reproduce it myself.  If you can submit a reproducible test script,
it'd be a big help.

> Oh, one more thing.  How do I, using SQL, determine if a table exists?
> EG, in Mysql it's something like:
> show tables like 'MyTable';

> In Interbase you select it out of the RDBS$RELATIONS table...

In PG you look for its entry in pg_class.  What, you wanted a standard ;-) ?

            regards, tom lane

pgsql-general by date:

Previous
From: "Floyd Shackelford"
Date:
Subject: can't get user authentication to work - HELP!
Next
From: "Pankaj Soni"
Date:
Subject: Pro. Regarding Arrays.