aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2019-07-13 10:35:34 +1200
committerThomas Munro <tmunro@postgresql.org>2019-07-13 10:35:34 +1200
commitb31fbe852c095a827caade2e0702f8a215053bea (patch)
treede2639248cc767897adb4bebe6509bdc4e847648 /src/backend
parentd3751adcf14d3baacc9738ee9ce869dc1c31d7ad (diff)
downloadpostgresql-b31fbe852c095a827caade2e0702f8a215053bea.tar.gz
postgresql-b31fbe852c095a827caade2e0702f8a215053bea.zip
Warn if wal_level is too low when creating a publication.
Provide a hint to users that they need to increase wal_level before subscriptions can work. Author: Lucas Viecelli, with some adjustments by Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAPjy-57rn5Y9g4e5u--eSOP-7P4QrE9uOZmT2ZcUebF8qxsYhg%40mail.gmail.com
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/publicationcmds.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index 1ac1a71bd95..f115d4bf805 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -232,6 +232,14 @@ CreatePublication(CreatePublicationStmt *stmt)
InvokeObjectPostCreateHook(PublicationRelationId, puboid, 0);
+ if (wal_level != WAL_LEVEL_LOGICAL)
+ {
+ ereport(WARNING,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("wal_level is insufficient to publish logical changes"),
+ errhint("Set wal_level to logical before creating subscriptions.")));
+ }
+
return myself;
}