can't duplicate an error in a restored DB

From: Stefan Murphy <stefanpostgres(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: can't duplicate an error in a restored DB
Date: 2009-01-22 19:01:10
Message-ID: cf748ad90901221101h66204cces63043cc0364bbfa5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Postgres 8.1.11

I'm getting an error when trying to drop a primary key from a table
because of foreign key constraints. This is OK, not worried about
that. I am worried that I can't duplicate the problem in a DB created
from a backup of my primary DB.

The error happens in my primary production database. However, I can't
duplicate the problem on a DB that has been restored from a dump of
the production DB. I even took my production WAL DB out of standby,
backed it up, recreated the error, restored from the backup I just
made and can no longer recreate the error.

My question: Am I doing something wrong in how I backup and restore a
DB? Or is there something else going on here?

How I'm dumping/restoring the db below. There is just the default
postgres DB and my DB named hdap.

linux: pg_dumpall -p 6543 > backup.file
psql: drop database hdap
linux: psql -f backup.file

Below is the ERROR that I can't duplicate in restored DB.

Production
db2/[local] hdap=# ALTER TABLE device.device_types DROP CONSTRAINT
"device_types_pkey" CASCADE;
ALTER TABLE device.device_types DROP CONSTRAINT "device_types_pkey" CASCADE;
NOTICE: drop cascades to constraint
device_kit_type_members_device_type_id_fkey on table
device.device_kit_type_members
ERROR: "device_kit_type_members_pkey" is an index

DB created Production pg_dumpall
db6/[local] hdap=# ALTER TABLE device.device_types DROP CONSTRAINT
"device_types_pkey" CASCADE;
ALTER TABLE device.device_types DROP CONSTRAINT "device_types_pkey" CASCADE;
NOTICE: drop cascades to constraint devices_device_type_id_fkey on
table device.devices
NOTICE: drop cascades to constraint
device_type_properties_device_type_id_fkey on table
device.device_type_properties
NOTICE: drop cascades to constraint
device_kit_type_members_device_type_id_fkey on table
device.device_kit_type_members
ALTER TABLE

Browse pgsql-general by date

  From Date Subject
Next Message Vladimir Konrad 2009-01-22 20:04:42 Re: problem converting database to UTF-8
Previous Message decibel 2009-01-22 18:16:36 Re: deductive databases in postgreSQL