Re: pg_dump does not dump tables created in information_schema schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump does not dump tables created in information_schema schema
Date: 2021-10-07 16:00:04
Message-ID: 65539.1633622404@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Thursday, October 7, 2021, vignesh C <vignesh21(at)gmail(dot)com> wrote:
>> Should tables be allowed to create in "information_schema" schema, if
>> yes should the tables/publications be dumped while dumping database
>> contents?

> I presume you have to be superuser to do this. If so, this would seem to
> fit under the “we don’t stop you, but you shouldn’t” advice that we apply
> throughout the system, like in say modifying stuff in pg_catalog.
> Information_schema is an internal schema attached to an static for a given
> release.

It is (supposed to be) possible for a superuser to drop information_schema
post-initdb and then recreate it by sourcing the information_schema.sql
file. In fact, I seem to recall that we've recommended doing so in past
minor releases to correct errors in information_schema declarations.
So it's fairly hard to see how we could enforce prohibitions against
changing information_schema objects without breaking that use-case.
On the other hand, just because you did that doesn't mean that you want
information_schema to start showing up in your dumps. Quite the opposite
in fact, because then you'd have problems with trying to load the dump
into a newer PG version that might need different information_schema
contents.

So I agree: there's nothing to be done here, and the proposed scenario
is a case of "superusers should know better than to do that".

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2021-10-07 16:05:19 Re: Role Self-Administration
Previous Message Bruce Momjian 2021-10-07 15:54:54 Re: storing an explicit nonce