Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude schemas owned by extensions #127

Merged

Conversation

bplunkett-stripe
Copy link
Collaborator

Description

Exclude schemas owned by extensions.

Example:

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:

  1. Drop extension pg_repack
  2. 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

@bplunkett-stripe bplunkett-stripe merged commit b1bd977 into main Apr 29, 2024
6 checks passed
@bplunkett-stripe bplunkett-stripe deleted the bplunkett/exclude-schemas-owned-by-extensions branch April 29, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants