use a different query to fetch materialized view structure

This commit is contained in:
Dan Sosedoff
2016-01-17 15:00:33 -06:00
parent 84f1bd95e7
commit 3167d96cfc
6 changed files with 75 additions and 41 deletions

View File

@@ -92,6 +92,23 @@ WHERE
// ---------------------------------------------------------------------------
PG_MATERIALIZED_VIEW_SCHEMA = `
SELECT
attname as column_name,
atttypid::regtype AS data_type,
(case when attnotnull IS TRUE then 'NO' else 'YES' end) as is_nullable,
null as character_maximum_length,
null as character_set_catalog,
null as column_default
FROM
pg_attribute
WHERE
attrelid = $1::regclass AND
attnum > 0 AND
NOT attisdropped`
// ---------------------------------------------------------------------------
PG_ACTIVITY = `
SELECT
datname,