Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

update gp by duck:ERROR: multiple updates to a row by the same query is not allowed

Open
#226 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
postgresql, python
Domain
databases

Research direction

Start by reproducing the two UPDATE statements with the reported DuckDB 0.10.1, Greenplum 6.12, and Python client setup. Inspect the PL/Python function p_rst_ra_skc_org_detail at lines 2743 and 19, where exesql executes the generated SQL, and compare why the temporary DuckDB table produces duplicate matches while the Greenplum table does not. Done means the cause and a verified resolution are documented.

Written by the indexing model from the issue text.

Description

my sql:

update gp.tenant_peacebird_biz.rst_ra_sku_org_detail a 
set	compute_status='0'
    from tmp_distinct_order_id b
    where a.skc_order_id=b.skc_order_id
    and a.day_date = '2024-04-29' and a.is_deleted = '0';

raise error:

ERROR: duckdb.duckdb.Error: Failed to execute query "UPDATE "tenant_peacebird_biz"."rst_ra_sku_org_detail" 
SET "compute_status" = "update_data_63f7bf5c-4235-4a4b-8c40-ddbdf9382dfa"."compute_status" FROM "update_data_63f7bf5c-4235-4a4b-8c40-ddbdf9382dfa" WHERE "rst_ra_sku_org_detail".ctid=__page_id_string::TID":
 ERROR:  multiple updates to a row by the same query is not allowed  (seg0 172.18.10.106:33000 pid=61539) (plpy_elog.c:121)
  在位置:Traceback (most recent call last):
  PL/Python function "p_rst_ra_skc_org_detail", line 2743, in <module>
    exesql(sql)	
  PL/Python function "p_rst_ra_skc_org_detail", line 19, in exesql
    dd.execute(sql)
PL/Python function "p_rst_ra_skc_org_detail"

If I write the duck table into gp,and then run sql, it's OK:

update tenant_peacebird_biz.rst_ra_sku_org_detail a 
set	compute_status='0'
    from tenant_peacebird_biz.tmp_id b
    where a.skc_order_id=b.skc_order_id
    and a.day_date = '2024-04-29' and a.is_deleted = '0';

why?
and how to resolve?

OS:
Centos7

Greenplum Version:
6.12 (pg:9.4)

DuckDB Version:
0.10.1

DuckDB Client:
python

Dominant language
C++
Stars
372
Forks
107
Avg merge
13h 55m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-postgres

All issues in duckdb/duckdb-postgres

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.