Re: Problems when dumping a database - Mailing list pgsql-general

From Tom Lane
Subject Re: Problems when dumping a database
Date
Msg-id 26731.982898627@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problems when dumping a database  (Tressens Lionel <tressens@etud.insa-tlse.fr>)
Responses Re: Problems when dumping a database
List pgsql-general
Tressens Lionel <tressens@etud.insa-tlse.fr> writes:
> Le 20.02.01 � 13:18, "Tom Lane" �crivait :
> )Tressens Lionel <tressens@etud.insa-tlse.fr> writes:
> )> My pgsql DBMS works great except that when I want to dump a database,
> )> pg_dump says that database template1 doesn't exist (actually it does !)
> )> and the dump is aborted...
> )
> )Curious.  Can you connect to template1 by hand (eg "psql template1")?

> Yes I can. But something strange is that I can use the tables of the
> template1 database :

> template1=> select * from pg_shadow;     (this will work)

> But I cannot list them :

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

Hm.  Not finding any user tables in template1 is normal behavior ---
try \dS to view the system tables.  However, I now have a theory,
because psql has reported this condition as 'No relations found.'
since 7.0 or before.  Evidently you are invoking an old (6.5 or before)
psql.  What version is your database server, and is it possible you're
calling a psql of an older version?  And, even more to the point, a
pg_dump also of an older version?

> SELECT oid FROM pg_database WHERE datname = 'template1'

> But this SELECT returns two tuples ! I have two identical tuples in
> pg_database for template1.
> Perhaps deleting one will help me, but which one (equal ?).

This is definitely uncool, but I'm not sure if it's related to the
pg_dump problem or not.  You could try deleting the one of larger OID
(the correct OID for template1 is about 17000 depending on what version
you're running) and then do a pg_database vacuum.

            regards, tom lane

pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: Questions to lists / translations
Next
From: Tom Lane
Date:
Subject: Re: problem while compiling user c functions in 7.1beta4