Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix applying table privileges changes to wrong table if there are multiple tables with same name in different schema (#22123)

Joshen Lim37f549c36eeb
diff --git a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx b/apps/studio/pages/project/[ref]/auth/column-privileges.tsx
index 3ca71115b86..b3aa68fb561 100644
--- a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx
+++ b/apps/studio/pages/project/[ref]/auth/column-privileges.tsx
@@ -137,7 +137,9 @@ const PrivilegesPage: NextPageWithLayout = () => {
allRoles?.filter((role: PostgresRole) => EDITABLE_ROLES.includes(role.name)) ?? []
const roles = rolesList.map((role: PostgresRole) => role.name)
- const table = tableList?.find((table) => table.name === selectedTable)
+ const table = tableList?.find(
+ (table) => table.schema === selectedSchema && table.name === selectedTable
+ )
const isLocked = EXCLUDED_SCHEMAS.includes(selectedSchema)
const {