Skip to content

Fall back to SQL formatting for non-PL/pgSQL bodies#11

Merged
gmr merged 1 commit into
mainfrom
fix/plpgsql-sql-fallback
Jun 15, 2026
Merged

Fall back to SQL formatting for non-PL/pgSQL bodies#11
gmr merged 1 commit into
mainfrom
fix/plpgsql-sql-fallback

Conversation

@gmr

@gmr gmr commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

format_plpgsql errored on LANGUAGE sql function bodies — a bare SQL statement such as WITH … SELECT … — because they aren't PL/pgSQL blocks. pglifecycle hit this on check_for_invalid_domains.

When the PL/pgSQL parse has errors, try format() (SQL) and return that if it parses cleanly; otherwise report the original PL/pgSQL syntax error. This lets callers that route all function bodies through format_plpgsql handle SQL-language functions, and only changes behavior in the previously-erroring case.

Verification

🤖 Generated with Claude Code

format_plpgsql errored on LANGUAGE sql function bodies (a bare SQL
statement such as WITH … SELECT). When the PL/pgSQL parse has errors,
try SQL formatting and use it if it parses cleanly; otherwise report
the original PL/pgSQL syntax error. This lets callers that route all
function bodies through format_plpgsql handle SQL-language functions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@gmr, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 19 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3dd70b4b-5a26-479b-a495-4e671741558f

📥 Commits

Reviewing files that changed from the base of the PR and between 30a0b34 and 57c38b4.

📒 Files selected for processing (2)
  • src/lib.rs
  • tests/plpgsql_test.rs

Comment @coderabbitai help to get the list of available commands and usage tips.

@gmr gmr merged commit 2fcda0b into main Jun 15, 2026
3 checks passed
@gmr gmr deleted the fix/plpgsql-sql-fallback branch June 15, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant