8000 fix(publications): disambiguate tables' schemas · wasabigeek/postgres-meta@c304018 · GitHub
[go: up one dir, main page]

Skip to content

Commit c304018

Browse files
committed
fix(publications): disambiguate tables' schemas
1 parent f4d7f9d commit c304018

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/lib/sql/publications.sql

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,22 @@ FROM
1515
LEFT JOIN LATERAL (
1616
SELECT
1717
COALESCE(
18-
array_agg(c.relname :: text) filter (
19-
WHERE
20-
c.relname IS NOT NULL
18+
array_agg(
19+
json_build_object(
20+
'id',
21+
c.oid :: int8,
22+
'name',
23+
c.relname,
24+
'schema',
25+
nc.nspname
26+
)
2127
),
2228
'{}'
2329
) AS tables
2430
FROM
2531
pg_catalog.pg_publication_rel AS pr
2632
JOIN pg_class AS c ON pr.prrelid = c.oid
33+
join pg_namespace as nc on c.relnamespace = nc.oid
2734
WHERE
2835
pr.prpubid = p.oid
2936
) AS pr ON 1 = 1

0 commit comments

Comments
 (0)
0