View pg_object_ownership
Creates a view with information about the ownership of objects. Since PostgreSQL 11 supports procedures, therefore there is one version vor PostgreSQL 10. This view is supported in PostgreSQL 10 or newer. Older versions are not supported.
Columns
| Column Name | datatype | Description |
|---|---|---|
| oid | oid | The object identifier of the object. |
| object_schema | name | The schema name where the object is stored in. |
| owner | name | The role name that owns the object. |
| object_type | text | The type of object, for example TABLE, INDEX, etc. |
| deptype | “char” | The dependency shortcut, see dependency_type for further description. |
| dependency_type | text | The description of the deptype: n = DEPENDENCY_NORMAL, a = DEPENDENCY_AUTO, i = DEPENDENCY_INTERNAL, P = DEPENDENCY_PARTITION_PRI, S = DEPENDENCY_PARTITION_SEC, e = DEPENDENCY_EXTENSION, p = DEPENDENCY_PIN, others: NOT DEFINED, SEE DOCUMENTATION. |
Example
SELECT *
FROM pg_object_ownership
WHERE owner = 'stefanie';
Result:
| oid | object_schema | object_name | owner | object_type | deptype | dependency_type |
|---|---|---|---|---|---|---|
| 17078 | public | pg_object_ownership | stefanie | VIEW | n | DEPENDENCY_NORMAL |
| 17079 | public | gapfillinternal | stefanie | FUNCTION | n | DEPENDENCY_NORMAL |
| 18028 | public | gapfill | stefanie | AGGREGATE FUNCTION | n | DEPENDENCY_NORMAL |
| 18039 | public | to_unix_timestamp | stefanie | FUNCTION | n | DEPENDENCY_NORMAL |
| 18068 | public | to_unix_timestamp | stefanie | FUNCTION | n | DEPENDENCY_NORMAL |