Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91e7115

Browse files
committed
Throw a more on-point error for publications depending on columns.
Same as42b0412, except that the trouble case is a publicationWHERE clause that depends on a column.Again reported by Alexander Lakhin. Back-patch to v15 wherewe added publication WHERE clauses.Discussion:https://postgr.es/m/548a47bc-87ae-b3df-c6a2-60b9966f808b@gmail.com
1 parentd45597f commit91e7115

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "catalog/pg_opclass.h"
4747
#include "catalog/pg_policy.h"
4848
#include "catalog/pg_proc.h"
49+
#include "catalog/pg_publication_rel.h"
4950
#include "catalog/pg_rewrite.h"
5051
#include "catalog/pg_statistic_ext.h"
5152
#include "catalog/pg_tablespace.h"
@@ -14227,6 +14228,21 @@ RememberAllDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype,
1422714228
RememberStatisticsForRebuilding(foundObject.objectId, tab);
1422814229
break;
1422914230

14231+
case PublicationRelRelationId:
14232+
14233+
/*
14234+
* Column reference in a PUBLICATION ... FOR TABLE ... WHERE
14235+
* clause. Same issues as above. FIXME someday.
14236+
*/
14237+
if (subtype == AT_AlterColumnType)
14238+
ereport(ERROR,
14239+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
14240+
errmsg("cannot alter type of a column used by a publication WHERE clause"),
14241+
errdetail("%s depends on column \"%s\"",
14242+
getObjectDescription(&foundObject, false),
14243+
colName)));
14244+
break;
14245+
1423014246
default:
1423114247

1423214248
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp