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/qualify base model schemas #27

Merged
merged 3 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion models/base/pg_attribute.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ select
, (case attsortkeyord
when 1 then attname
else null end) as sort_key
from pg_attribute
from pg_catalog.pg_attribute
2 changes: 1 addition & 1 deletion models/base/pg_class.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ select
, relhasrules
, relhassubclass
, relacl
from pg_class
from pg_catalog.pg_class
2 changes: 1 addition & 1 deletion models/base/pg_depend.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ select
, refobjid
, refobjsubid
, deptype
from pg_depend
from pg_catalog.pg_depend
2 changes: 1 addition & 1 deletion models/base/pg_namespace.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ select
, nspname
, nspowner
, nspacl
from pg_namespace
from pg_catalog.pg_namespace
2 changes: 1 addition & 1 deletion models/base/pg_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ select
, hasindexes as has_indexes
, hasrules as has_rules
, hastriggers as has_triggers
from pg_tables
from pg_catalog.pg_tables
2 changes: 1 addition & 1 deletion models/base/pg_user.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ select
usesysid as user_id
, usename as username

from pg_user
from pg_catalog.pg_user
2 changes: 1 addition & 1 deletion models/base/pg_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ select
schemaname as schema_name
, viewname as view_name
, viewowner as view_owner
from pg_views
from pg_catalog.pg_views
2 changes: 1 addition & 1 deletion models/base/stl_explain.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ select
, plannode
, info

from stl_explain
from pg_catalog.stl_explain
2 changes: 1 addition & 1 deletion models/base/stl_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ select
, endtime as finished_at
, aborted

from stl_query
from pg_catalog.stl_query
2 changes: 1 addition & 1 deletion models/base/stl_wlm_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ select
, service_class_end_time
, final_state

from stl_wlm_query
from pg_catalog.stl_wlm_query
2 changes: 1 addition & 1 deletion models/base/stv_blocklist.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ select
, num_readers
, id
, flags
from stv_blocklist
from pg_catalog.stv_blocklist
20 changes: 20 additions & 0 deletions models/base/stv_partitions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
select

owner
, host
, diskno
, part_begin
, part_end
, used
, tossed
, capacity
, "reads"
, writes
, seek_forward
, seek_back
, is_san
, failed
, mbps
, mount

from pg_catalog.stv_partitions
2 changes: 1 addition & 1 deletion models/base/stv_tbl_perm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ select
, temp
, db_id
, backup
from stv_tbl_perm
from pg_catalog.stv_tbl_perm
2 changes: 1 addition & 1 deletion models/base/svv_diskusage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ select
, num_readers
, id
, flags
from svv_diskusage
from pg_catalog.svv_diskusage
3 changes: 1 addition & 2 deletions models/views/redshift_admin_table_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ with unsorted_by_table as (

select
sum(capacity) as total_megabytes
from
stv_partitions
from {{ref('stv_partitions')}}
where part_begin=0

), table_distribution_ratio as (
Expand Down