Re: Extensions not dumped when --schema is used

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-05-20T09:55:24Z
Lists: pgsql-hackers
> On 20 May 2020, at 11:38, Guillaume Lelarge <guillaume@lelarge.info> wrote:

> Actually, "dump all extensions" (#3) would make sense to me, and has my vote.

Wouldn't that open for another set of problems when running with --schema=bar
and getting errors on restoring for relocatable extensions like these:

	CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA foo;

Only dumping extensions depended on has the same problem of course.

> People dump databases, schemas, and tables. Theu usually don't know which extensions those objects depend on.

That I totally agree with, question is how we best can help users here.

cheers ./daniel


Commits

  1. Tweak behavior of pg_dump --extension with configuration tables

  2. Remove duplicated --no-sync switches in new tests of test_pg_dump

  3. Add support for --extension in pg_dump