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

fix: add pg_matview table #2523

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/sqlbuiltins/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,20 @@ 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
universalmind303 marked this conversation as resolved.
Show resolved Hide resolved
",
});

impl BuiltinView {
pub fn builtins() -> Vec<&'static BuiltinView> {
vec![
Expand All @@ -705,6 +719,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
Loading