mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Re-allow INSERT .. ON CONFLICT DO NOTHING on partitioned tables.
Commit8355a011a0
was reverted inf05230752d
, but this attempt is hopefully better-considered: we now pass the correct value to ExecOpenIndices, which should avoid the crash that we hit before. Amit Langote, reviewed by Simon Riggs and by me. Some final editing by me. Discussion: http://postgr.es/m/7ff1e8ec-dc39-96b1-7f47-ff5965dceeac@lab.ntt.co.jp
This commit is contained in:
@@ -847,16 +847,8 @@ transformInsertStmt(ParseState *pstate, InsertStmt *stmt)
|
||||
|
||||
/* Process ON CONFLICT, if any. */
|
||||
if (stmt->onConflictClause)
|
||||
{
|
||||
/* Bail out if target relation is partitioned table */
|
||||
if (pstate->p_target_rangetblentry->relkind == RELKIND_PARTITIONED_TABLE)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("ON CONFLICT clause is not supported with partitioned tables")));
|
||||
|
||||
qry->onConflict = transformOnConflictClause(pstate,
|
||||
stmt->onConflictClause);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have a RETURNING clause, we need to add the target relation to
|
||||
|
Reference in New Issue
Block a user