Skip to content

Commit

Permalink
fix: add pg_matview table (#2523)
Browse files Browse the repository at this point in the history
@talagluck this should fix the great-expectations issue you referenced
in #2436

---------

Co-authored-by: Sean Smith <scsmithr@gmail.com>
  • Loading branch information
2 people authored and tychoish committed Feb 1, 2024
1 parent ef70e4d commit 712ae2c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions crates/sqlbuiltins/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,21 @@ FROM (VALUES (NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL)) WHERE false",
});

pub static PG_MATVIEWS: Lazy<BuiltinView> = Lazy::new(|| BuiltinView {
schema: POSTGRES_SCHEMA,
name: "pg_matviews",
sql: "
SELECT '' as schemaname,
'' as matviewname,
'' as matviewowner,
'' as tablespace,
false as hasindexes,
false as ispopulated,
'' as definition
WHERE false
",
});

impl BuiltinView {
pub fn builtins() -> Vec<&'static BuiltinView> {
vec![
Expand All @@ -705,6 +720,7 @@ impl BuiltinView {
&PG_TABLES,
&PG_VIEWS,
&PG_TYPE,
&PG_MATVIEWS,
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion testdata/sqllogictests/pg_catalog.slt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ AND (c.relname) LIKE '%'
AND n.nspname = 'pg_catalog'
LIMIT 1000;

statement ok
select * from pg_matviews;

# https://github.com/GlareDB/glaredb/issues/2475
statement ok
Expand Down Expand Up @@ -161,4 +163,4 @@ WHERE
t.select
OR t.update
OR t.insert
OR t.delete
OR t.delete

0 comments on commit 712ae2c

Please sign in to comment.