Re: Problems when dumping a database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tressens Lionel <tressens(at)etud(dot)insa-tlse(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problems when dumping a database
Date: 2001-02-23 03:23:47
Message-ID: 26731.982898627@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tressens Lionel <tressens(at)etud(dot)insa-tlse(dot)fr> writes:
> Le 20.02.01 13:18, "Tom Lane" crivait :
> )Tressens Lionel <tressens(at)etud(dot)insa-tlse(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Lance Taylor 2001-02-23 03:49:56 Re: Building SPI programs
Previous Message Neil Conway 2001-02-23 03:15:46 Re: Questions to lists / translations