Skip to content

Commit

Permalink
Don't dump views for Postgres extensions
Browse files Browse the repository at this point in the history
If a database view has the same name as a database extension, we want to
ignore that view and not dump it with the rest of the schema. (The
extension will already be handled through the schema's
`enable_extension` statement.) This approach will handle system views
from extensions like PostGIS whose views do not begin with `pg_`.

WIP
  • Loading branch information
geoffharcourt authored and derekprior committed Jan 23, 2015
1 parent 9fb3de6 commit 325988a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/scenic/adapters/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def self.views
SELECT viewname, definition
FROM pg_views
WHERE schemaname = ANY (current_schemas(false))
AND viewname NOT IN (SELECT extname FROM pg_extension)
SQL
end

Expand Down

0 comments on commit 325988a

Please sign in to comment.