Repository navigation
PostgreSQL: Support BEGIN ATOMIC function bodies - #2728
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2728 +/- ##
=======================================
Coverage 82.30% 82.30%
=======================================
Files 42 42
Lines 35307 35327 +20
Branches 35307 35327 +20
=======================================
+ Hits 29058 29075 +17
+ Misses 2691 2688 -3
- Partials 3558 3564 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/begin-atomic-function-body
branch
from
October 26, 2026 18:58
5dcc527 to
9aef0bb
Compare
LucaCappelletti94
force-pushed
the
upstream/begin-atomic-function-body
branch
from
October 26, 2026 20:18
9aef0bb to
565b633
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CREATE FUNCTIONrejected the SQL-standard body that PostgreSQL 14 added.CREATE FUNCTION f() RETURNS INT LANGUAGE sql BEGIN ATOMIC SELECT 1; ENDfailed withExpected: end of statement, found: BEGINunder bothPostgreSqlDialectandGenericDialect, andpg_dumpwrites SQL functions with such bodies in exactly this form.The PostgreSQL
CREATE FUNCTIONoption loop now readsBEGIN ATOMICand the statements up toEND, and stores them in a newCreateFunctionBody::BeginAtomicvariant that reusesBeginEndStatements. PostgreSQL writes noASbefore the block, so a separate variant keeps it apart from the SQL ServerAS BEGIN ... ENDbody. ARETURN expr;inside the block parses as the existingStatement::Return.