Skip to content

Commit d5a88f5

Browse files
authored
let operator fix publications without tables (#2722)
1 parent 85b8058 commit d5a88f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cluster/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const (
4646
createExtensionSQL = `CREATE EXTENSION IF NOT EXISTS "%s" SCHEMA "%s"`
4747
alterExtensionSQL = `ALTER EXTENSION "%s" SET SCHEMA "%s"`
4848

49-
getPublicationsSQL = `SELECT p.pubname, string_agg(pt.schemaname || '.' || pt.tablename, ', ' ORDER BY pt.schemaname, pt.tablename)
49+
getPublicationsSQL = `SELECT p.pubname, COALESCE(string_agg(pt.schemaname || '.' || pt.tablename, ', ' ORDER BY pt.schemaname, pt.tablename), '') AS pubtables
5050
FROM pg_publication p
5151
LEFT JOIN pg_publication_tables pt ON pt.pubname = p.pubname
5252
WHERE p.pubowner = 'postgres'::regrole

0 commit comments

Comments
 (0)