Re: If a schema is created as part of an extension, should all user created tables created in that schema be considered part of the extension?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Regina Obe" <lr(at)pcorp(dot)us>
Cc: "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: If a schema is created as part of an extension, should all user created tables created in that schema be considered part of the extension?
Date: 2016-03-26 14:16:23
Message-ID: 2872.1459001783@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Regina Obe" <lr(at)pcorp(dot)us> writes:
> I just discovered something which was a little alarming to me.
> In the postgis_tiger_geocoder extension, I had switched to having the schema
> where user data download is stored created as part of create extension
> script so I wouldn't need to check during load.
> ...
> When I recently did a full database backup (not excluding tiger_data), I
> discovered that none of the tables were in the backup file.

I think the chain of events is that the tiger_data schema is marked as
not to be backed up (because it belongs to an extension) and then all
of its tables are marked as not to be backed up because they're in a
schema that's not to be backed up. The latter behavior is meant to
implement --exclude-schema but it's firing on this case too. I think
it might've behaved differently before c42df2d46.

The whole idea of non-extension objects in a schema owned by an extension
seems pretty grotty to me though; that would mean that dropping the
extension forces dropping those objects, which I wouldn't think you want.
So I'm not sure it's worth complicating matters to make this case behave
differently in pg_dump.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-26 14:25:41 Re: Alter or rename enum value
Previous Message Tom Lane 2016-03-26 14:01:40 Re: Can we amend gitignore so git postgresql works with git on windows using Msys/Mingw64