mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Allow ON CONFLICT .. DO NOTHING on a partitioned table.
ON CONFLICT .. DO UPDATE still doesn't work, for lack of a way of enforcing uniqueness across partitions, but we can still allow this case. Amit Langote, per discussion with Peter Geoghegan. Additional wordsmithing by me. Discussion: http://postgr.es/m/CAA-aLv7Z4uygtq-Q5CvDi9Y=VZxUyEnuWjL=EwCfOof=L04hgg@mail.gmail.com
This commit is contained in:
@@ -842,16 +842,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