Here are a collection of AWS Redshift administration scripts which list the ownership of the objects.

Find ownership of views and tables

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
SELECT n.nspname AS schema_name,
    pg_get_userbyid(c.relowner) AS table_owner,
    c.relowner,
    c.relname AS table_name,
    CASE
        WHEN c.relkind = 'v' THEN 'view'
        ELSE 'table'
    END AS table_type,
    d.description AS table_description
FROM pg_class As c
    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
    LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace
    LEFT JOIN pg_description As d ON (
        d.objoid = c.oid
        AND d.objsubid = 0
    )
WHERE c.relkind IN('r', 'v')
    AND c.relowner <> 1;

Find ownership of stored procedures

1
2
3
4
5
6
7
SELECT n.nspname AS schema_name,
    pg_get_userbyid(p.proowner) AS proc_owner,
    p.proowner,
    p.proname AS pro_name
FROM pg_proc As p
    LEFT JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE p.proowner <> 1;