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

INSERT ... RETURNING clause returns error when inserting into Postgres table

Open
#175 1 comment 1 reaction 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
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, python
Domain
databases

Research direction

Start by reproducing the INSERT ... RETURNING example from the issue through the Python client against a Postgres table, using the reported 0.9.2 behavior and a current main build. Read the linked INSERT RETURNING documentation and trace the Postgres-table insertion path to determine whether the clause should work or be documented as unsupported. Done means the intended behavior is established and either the generated id is returned or the documentation clearly matches the limitation.

Written by the indexing model from the issue text.

Description

What happens?

When attempting to insert into a Postgres table and return the auto-generated ID for use in indexing, the following error is thrown:

Binder Error: RETURNING clause not yet supported for insertion into Postgres table

This isn't mentioned in the docs here as being unsupported, so would be great to know if it's intended or a bug!

To Reproduce

Insert into any postgres table, e.g. for a users table with just an id and name:

INSERT INTO users (name)
VALUES (`test_name`)
RETURNING id;
OS:

MacOS Sonoma 14.1

DuckDB Version:

0.9.2

DuckDB Client:

Python

Full Name:

Tyler Dammann

Affiliation:

Bruinen

Have you tried this on the latest main branch?

I have tested with a main build

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
  • Yes, I have
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.