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

Commit7b2ccc5

Browse files
committed
Fix rule-detection code for MERGE.
Use the relation's rd_rules structure to test whether it has rules,rather than the relhasrules flag, which might be out of date.Reviewed by Tom Lane.Backpatch to 15, where MERGE was added.Discussion:https://postgr.es/m/CAEZATCVkBVZABfw71sYvkcPf6tarcOFST5Bc6AOi-LFT9YdccQ%40mail.gmail.com
1 parentb1d0158 commit7b2ccc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/parser/parse_merge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ transformMergeStmt(ParseState *pstate, MergeStmt *stmt)
182182
errmsg("cannot execute MERGE on relation \"%s\"",
183183
RelationGetRelationName(pstate->p_target_relation)),
184184
errdetail_relkind_not_supported(pstate->p_target_relation->rd_rel->relkind)));
185-
if (pstate->p_target_relation->rd_rel->relhasrules)
185+
if (pstate->p_target_relation->rd_rules!=NULL&&
186+
pstate->p_target_relation->rd_rules->numLocks>0)
186187
ereport(ERROR,
187188
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
188189
errmsg("cannot execute MERGE on relation \"%s\"",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp