Skip to content

Support ON CONFLICT DO SELECT on hypertables - #10279

Merged
svenklemm merged 1 commit into
mainfrom
sven/pg19_do_select
Jul 31, 2026
Merged

Support ON CONFLICT DO SELECT on hypertables#10279
svenklemm merged 1 commit into
mainfrom
sven/pg19_do_select

Conversation

@svenklemm

@svenklemm svenklemm commented Jul 16, 2026

Copy link
Copy Markdown
Member

PostgreSQL 19 adds INSERT ... ON CONFLICT DO SELECT, which returns the
conflicting row instead of updating it and can optionally lock it.

Upstream PostgreSQL commit:
postgres/postgres@8832709

@github-actions

Copy link
Copy Markdown

@kpan2034, @melihmutlu: please review this pull request.

Powered by pull-review

@svenklemm svenklemm changed the title sven/pg19 do select Support ON CONFLICT DO SELECT on hypertables Jul 16, 2026
@svenklemm svenklemm added this to the v2.29.0 milestone Jul 16, 2026
@svenklemm svenklemm added the pg19 label Jul 16, 2026
@svenklemm
svenklemm force-pushed the sven/pg19_do_select branch 2 times, most recently from 8b85faf to 0317fda Compare July 16, 2026 20:45

@antekresic antekresic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to add a test that shows this doesn't trigger DML decompression, making that fact more explicit in the test output.

Otherwise, LGTM.

* Returns true if we're done (with or without a select), or false if the
* caller must retry the INSERT from scratch.
*
* copied and modified version of ExecOnConflictSelect from

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not evident what was modified from the PG version, should we make that more clear?

@svenklemm svenklemm modified the milestones: v2.29.0, v2.30.0 Jul 23, 2026
@svenklemm
svenklemm force-pushed the sven/pg19_do_select branch 4 times, most recently from e128c69 to b3c2a35 Compare July 31, 2026 15:31
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/chunk_insert_state.c 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@svenklemm
svenklemm force-pushed the sven/pg19_do_select branch from b3c2a35 to 48b5b32 Compare July 31, 2026 15:46
PostgreSQL 19 added INSERT ... ON CONFLICT DO SELECT, which returns the
conflicting row instead of updating it and can optionally lock it.

Upstream changes:
Add support for INSERT ... ON CONFLICT DO SELECT.
postgres/postgres@88327092ff0
@svenklemm
svenklemm force-pushed the sven/pg19_do_select branch from 48b5b32 to ca76727 Compare July 31, 2026 15:56
@svenklemm
svenklemm merged commit 774cee2 into main Jul 31, 2026
67 of 71 checks passed
@svenklemm
svenklemm deleted the sven/pg19_do_select branch July 31, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants