diff --git a/crates/sqlbuiltins/src/builtins.rs b/crates/sqlbuiltins/src/builtins.rs index 1b9a544b5..f6780c3a9 100644 --- a/crates/sqlbuiltins/src/builtins.rs +++ b/crates/sqlbuiltins/src/builtins.rs @@ -704,6 +704,35 @@ pub static PG_MATVIEWS: Lazy = Lazy::new(|| BuiltinView { ", }); +pub static PG_REWRITE: Lazy = Lazy::new(|| BuiltinView { + schema: POSTGRES_SCHEMA, + name: "pg_rewrite", + sql: " + SELECT 0 as oid, + '' as rulename, + 0 as ev_class, + 1 as ev_type, + 'D' as ev_enabled, + false as is_instead, + null as ev_qual, + null as ev_action + ", +}); + +pub static PG_DEPEND: Lazy = Lazy::new(|| BuiltinView { + schema: POSTGRES_SCHEMA, + name: "pg_depend", + sql: " + SELECT 0 as classid, + 0 as objid, + 0 as objsubid, + 0 as refclassid, + 0 as refobjid, + 0 as refobjdubid, + 'a' as deptype, + ", +}); + impl BuiltinView { pub fn builtins() -> Vec<&'static BuiltinView> { vec![ @@ -721,6 +750,8 @@ impl BuiltinView { &PG_VIEWS, &PG_TYPE, &PG_MATVIEWS, + &PG_REWRITE, + &PG_DEPEND, ] } } diff --git a/testdata/sqllogictests/pg_catalog.slt b/testdata/sqllogictests/pg_catalog.slt index 5a6988c3d..871dbed49 100644 --- a/testdata/sqllogictests/pg_catalog.slt +++ b/testdata/sqllogictests/pg_catalog.slt @@ -121,6 +121,12 @@ LIMIT 1000; statement ok select * from pg_matviews; +statement ok +select * from pg_rewrite; + +statement ok +select * from pg_depend; + # https://github.com/GlareDB/glaredb/issues/2475 statement ok WITH table_privileges AS (