list redshift tables by owner

PHOTO EMBED

Tue Jul 25 2023 12:54:12 GMT+0000 (Coordinated Universal Time)

Saved by @vs #sql

select
    t.schemaname as db_schema,
    c.relname as table_name,
    t.tableowner as table_owner,
    c.relcreationtime as creationtime,
    *
from
    pg_catalog.pg_class_info c
    left join pg_catalog.pg_namespace n ON c.relnamespace = n.oid
    left join pg_catalog.pg_tables t on c.relname = t.tablename
where
    1 = 1
    --and t.tableowner like '%user_id'
    --and relname like '%revenues%'
;
content_copyCOPY