pg_repack creates a schema called pg_repack. Let's say the user's model.sql removes the CREATE EXTENSION pg_repack line. This will generate two statements:
Drop extension pg_repack
Drop schema pg_repack
The first line drops the pg_repack schema as well because it is owned by the extension, causing the second line to fail. As a result, we should stop generating statements for schemas owned by extensions, just like we do with other schema objects.
Motivation
Bug fix
Testing
There are few extensions that actually create extensions. One is pg_repack but it doesn't come with the default set of extensions in postgres-contrib. As a result, I just tested locally by creating pg_repack an
Description
Exclude schemas owned by extensions.
Example:
pg_repack creates a schema called pg_repack. Let's say the user's
model.sql
removes theCREATE EXTENSION pg_repack
line. This will generate two statements:The first line drops the pg_repack schema as well because it is owned by the extension, causing the second line to fail. As a result, we should stop generating statements for schemas owned by extensions, just like we do with other schema objects.
Motivation
Bug fix
Testing
There are few extensions that actually create extensions. One is pg_repack but it doesn't come with the default set of extensions in postgres-contrib. As a result, I just tested locally by creating
pg_repack
an