Skip to content

PostgreSQL: Support BEGIN ATOMIC procedure bodies - #2773

Open
LucaCappelletti94 wants to merge 2 commits into
mainfrom
upstream/begin-atomic-procedure-body
Open

LucaCappelletti94 wants to merge 2 commits into
mainfrom
upstream/begin-atomic-procedure-body

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE PROCEDURE p() LANGUAGE sql BEGIN ATOMIC INSERT INTO t VALUES (1); END failed with Expected: AS, found: BEGIN under both PostgreSqlDialect and GenericDialect. PostgreSQL accepts the same SQL-standard body for procedures as for functions (https://www.postgresql.org/docs/current/sql-createprocedure.html), as raised in the review of #2728.

@codecov-commenter

codecov-commenter commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.88%. Comparing base (7812d86) to head (c35f8af).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2773      +/-   ##
==========================================
+ Coverage   82.87%   82.88%   +0.01%     
==========================================
  Files          42       42              
  Lines       35968    35982      +14     
  Branches    35968    35982      +14     
==========================================
+ Hits        29807    29825      +18     
+ Misses       2654     2653       -1     
+ Partials     3507     3504       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/sqlparser_postgres.rs Outdated
}

#[test]
fn parse_create_procedure_begin_atomic() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

parse_create_procedure has no dialect gating and the other CREATE PROCEDURE tests live in sqlparser_common.rs, so this one could go there with all_dialects(); every dialect round-trips these inputs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/begin-atomic-procedure-body branch from 637067e to bd7af2f Compare October 30, 2026 21:08
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/begin-atomic-procedure-body branch 3 times, most recently from 22ea3a6 to 26e459d Compare October 31, 2026 09:01
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/begin-atomic-procedure-body branch from 26e459d to c35f8af Compare October 31, 2026 18:49
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