duckdb / postgres_scanner

https://duckdb.org/docs/extensions/postgres
MIT License
227 stars 36 forks source link

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

Open tjdammann opened 8 months ago

tjdammann commented 8 months ago

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?

szarnyasg commented 8 months ago

Hello @tjdammann, thanks for opening this issue. I transferred it to the postgres_scanner repository. In general, the main documentation does not discuss limitations of extensions, so if we document this, we'll do so under the extension page.