Getting a "pg_dump error: sanity check failed!"

From: Tucker I Sylvestro <tsyl1(at)MIT(dot)EDU>
To: pgsql-bugs(at)postgresql(dot)org
Cc: tsyl1(at)MIT(dot)EDU
Subject: Getting a "pg_dump error: sanity check failed!"
Date: 1999-12-15 05:24:00
Message-ID: 199912150524.AAA29641@nerd-xing.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Your name : Tucker Sylvestro
Your email address : tsyl1(at)mit(dot)edu

System Configuration
---------------------
Architecture (example: Intel Pentium) : AMD K6-2

Operating System (example: Linux 2.0.26 ELF) : Red Hat Linux 6.0, 2.2.5-15

PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5.2

Compiler used (example: gcc 2.8.0) : gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

Please enter a FULL description of your problem:
------------------------------------------------

I am getting an error when I try and use pg_dump. I have two very simple
tables which I can access through both psql and perl scripts using
DBD::Pg. However, when I run pg_dump auto >out.txt, I get the message:
'failed sanity check, table customers was not found'

Another oddity I just discovered is that from psql, doing a '\d' tells me
I have no tables!

auto=> \d
Couldn't find any tables, sequences or indices!

However, I can do:

auto=> select cid, numorders, approved from customers;
cid|numorders|approved
- ---+---------+--------
1| 1|t
2| 2|t
3| 1|t
4| 3|f
.
.
.

Something really seems to be off internally; it's funny to see this:

auto=> \dt
Couldn't find any tables!
auto=> select orderid, date, site, filled from orders where orderid = 355;
orderid|date |site|filled
-------+----------------------+----+------
355|1999-10-31 14:16:46-05| 1|t
(1 row)

Am I creating the tables wrong? Why does psql and pg_dump not find
the tables even though I can access them? The way I create them is
with the following lines from a perl script:

$dbh->do('CREATE TABLE customers ('.
'cID serial,'.
'numOrders int4 default 1,'.
'lastFilled bool,'.
'approved bool default false,'.
'fName text,'.
'lName text,'.
'phone text,'.
'evePhone text,'.
'email text,'.
'comment text,'.
'address text)');

where $dbh is:

$dbh = DBI->connect("dbi:Pg:dbname=auto", "", "") or die $DBI::errstr;

Thanks for the help, I really need this to work to be able to back up the
database.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Any time I run 'pg_dump' this error occurs.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

I currently have not found a fix or workaround.

Browse pgsql-bugs by date

  From Date Subject
Next Message Tucker I Sylvestro 1999-12-15 05:37:20 Getting a "pg_dump error: sanity check failed!"
Previous Message Bruce Momjian 1999-12-14 22:02:03 Re: [BUGS] ECPG memory leak detected