Re: pg_dumpall storing multiple copies of DB's?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill McGonigle <mcgonigle(at)medicalmedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall storing multiple copies of DB's?
Date: 2002-03-05 17:09:22
Message-ID: 16469.1015348162@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bill McGonigle <mcgonigle(at)medicalmedia(dot)com> writes:
> ... Unless 7.1.3 has code to prevent duplicates and
> 7.0 (old system) didn't I would suspect pg_shadow looks the same now as
> it did then.

There is a unique index to prevent duplicate usesysid in 7.2, but not in
7.1. However, it doesn't look like 7.0's pg_dumpall did a join anyway,
so that's not the explanation.

> The current system, which only has one pg_shadow entry for the
> database's datdba, is still producing the dumps with multiple copies.
> When I run:
> SELECT datname, coalesce(usename, (select usename from pg_shadow where
> usesysid=(select datdba from pg_database where datname='template0'))),
> pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database
> d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn;
> (from pg_dumpall) I only see one copy of the database.

Most curious. What exactly do you see from that query? I'm wondering
if pg_dumpall's simplistic parsing of the output ("while read ...") is
getting fooled by embedded spaces or some such.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Trewern, Ben 2002-03-05 17:11:02 Re: Mandrake RPMs uploaded
Previous Message Thomas Lockhart 2002-03-05 16:46:52 Mandrake RPMs uploaded