pgschema
pgschema copied to clipboard
cross-schema table references in views should be fully qualified
Given the following database definition:
create schema some_schema;
create table public.some_table (id serial primary key);
create view some_schema.some_view as select * from public.some_table;
pgschema dump --schema some_schema has the following output:
--
-- pgschema database dump
--
-- Dumped from database version PostgreSQL 17.0
-- Dumped by pgschema version 1.4.0
--
-- Name: some_view; Type: VIEW; Schema: -; Owner: -
--
CREATE OR REPLACE VIEW some_view AS
SELECT id
FROM some_table;
you can see that the view definition here is not correct as the reference to some_table should be public.some_table as some_table is only defined in the public schema
just tested and this works great - thanks!