From 59652a744ab5ad747e43010e66b509054e830c6e Mon Sep 17 00:00:00 2001 From: "pedro.cunha" Date: Fri, 17 Oct 2025 16:28:05 +0100 Subject: [PATCH] fix: use schema namespace to assure that when tables with the same name exist in multiple schemas the properties are read properly --- src/dialects/postgres.parser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dialects/postgres.parser.ts b/src/dialects/postgres.parser.ts index 90f3026..adeabec 100644 --- a/src/dialects/postgres.parser.ts +++ b/src/dialects/postgres.parser.ts @@ -171,7 +171,8 @@ export class PostgresParser extends BaseDatabaseParser { where attrelid = c.conrelid and ARRAY[attnum] <@ c.conkey) as col, (select r.relname from pg_class r where r.oid = c.confrelid) as referenced_table from pg_constraint c - where c.conrelid = (select oid from pg_class where relname = '${table}') + where c.conrelid = (select oid from pg_class where relname = '${table}' and relnamespace = + (select oid from pg_namespace where nspname = '${schemaName}')) and (select r.relname from pg_class r where r.oid = c.confrelid) is not null `);