Skip to content
Merged
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
18 changes: 16 additions & 2 deletions src/psycopack/_introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,14 @@ def get_referring_fks(self, *, table: str) -> list[ReferringForeignKey]:
pg_namespace.nspname AS schema,
(
SELECT
tableowner = current_user
tableowner = current_user OR tableowner IN (
SELECT
rolname
FROM
pg_roles
WHERE
pg_has_role(current_user, pg_roles.oid, 'MEMBER')
)
FROM
pg_tables
WHERE
Expand Down Expand Up @@ -657,7 +664,14 @@ def is_table_owner(self, *, table: str, schema: str) -> bool:
psycopg.sql.SQL(
dedent("""
SELECT
tableowner = current_user
tableowner = current_user OR tableowner IN (
SELECT
rolname
FROM
pg_roles
WHERE
pg_has_role(current_user, pg_roles.oid, 'MEMBER')
)
FROM
pg_tables
WHERE
Expand Down
Loading