Thread: Deadlock Detection

Deadlock Detection

From
vardi@cs.rice.edu (Moshe Vardi)
Date:
How do I find out in Embedded SQL that a transaction has been aborted
due to a deadlock?

The closes error message in sqlca seems to be:

  -401 (ECPG_TRANS): Error in transaction processing line %d.
   PostgreSQL signaled that we cannot start, commit, or rollback the
   transaction.

but it does not seem to be informative enough.


Thanks,

Moshe Vardi
Rice University

Re: Deadlock Detection

From
Josh Berkus
Date:
Moshe,

> How do I find out in Embedded SQL that a transaction has been aborted
> due to a deadlock?

I don't think anyone on the NOVICE list has much familiarity with Embedded
PGSQL.  Try the HACKERS list instead.

FWIW, in 7.4 we will have SQLSTATE standards-compliant error codes which will
make analyzing such errors easier.

--
Josh Berkus
Aglio Database Solutions
San Francisco

pg_dump bug?

From
"Thilo Hille"
Date:
Hi,
I am using postgresl 7.2.3. Yesterday i have dumped a database using pg_dump
everthing was fine, but the dump was in the wrong order. There were indexes
and views createded before the corresponding table was created.
Its not a big deal but editing 250MB asciifiles isnt actually fun :)

i used "pg_dump dbname > dbname.sql" to dump and "pgsql dbname < dbname.sql"
to restore the database.

Did i missed something?
Are files dumped with pg_dump supposed to be restored with pg_restore or is
it a bug?

Regards
Thilo Hille


Re: pg_dump bug?

From
Tom Lane
Date:
"Thilo Hille" <thilo@resourcery.de> writes:
> I am using postgresl 7.2.3. Yesterday i have dumped a database using pg_dump
> everthing was fine, but the dump was in the wrong order. There were indexes
> and views createded before the corresponding table was created.

There are some bugs along that line, particularly in older releases.
If you're using one of the archive output formats then pg_restore can
be used to alter the restore order into something that will work.

            regards, tom lane