mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user