Re: pg_dumpall storing multiple copies of DB's? - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dumpall storing multiple copies of DB's?
Date
Msg-id 19779.1014786481@sss.pgh.pa.us
Whole thread Raw
In response to pg_dumpall storing multiple copies of DB's?  (Bill McGonigle <mcgonigle@medicalmedia.com>)
Responses Re: pg_dumpall storing multiple copies of DB's?  (Bill McGonigle <mcgonigle@medicalmedia.com>)
List pgsql-general
Bill McGonigle <mcgonigle@medicalmedia.com> writes:
> Under what circumstances might pg_dumpall store several copies of the
> database?  When I restore the database with psql < dumpfile I see 4-5
> occurances of each database.  This is on 7.1.3.

pg_dumpall gets the list of databases to store using a query along the
lines of

SELECT ... FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid)

If you happen to have multiple entries in pg_shadow with the same
usesysid, then the SELECT will generate multiple rows for the matching
databases.

7.2 has a unique index on pg_shadow.usesysid, so hopefully this failure
mode is a thing of the past now.  In the meantime, get rid of the extra
pg_shadow entries and dump again.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Is there a drawback when changing NAMEDATALEN to 64?
Next
From: Tom Lane
Date:
Subject: Re: pg_dump gives segmentation fault and cores