Skip to content

Add support for PostgreSQL version() in SQL federation#38564

Draft
somiljain2006 wants to merge 8 commits intoapache:masterfrom
somiljain2006:Version-function-issue
Draft

Add support for PostgreSQL version() in SQL federation#38564
somiljain2006 wants to merge 8 commits intoapache:masterfrom
somiljain2006:Version-function-issue

Conversation

@somiljain2006
Copy link
Copy Markdown
Contributor

@somiljain2006 somiljain2006 commented Mar 26, 2026

Fixes #37436

Changes proposed in this pull request:

  • Add support for PostgreSQL version() function in SQL federation
  • Register version function in pg_catalog via PostgreSQLSQLFederationFunctionRegister
  • Implement version() in the PostgreSQL federation function layer
  • Add unit tests to verify function registration and behavior
  • Ensure no registration occurs outside the pg_catalog schema

How was this tested?

  1. Verified using the provided Docker Compose setup with ShardingSphere Proxy
  2. Enabled SQL federation and connected via psql
  3. Executed select version();
  4. Confirmed query no longer throws SQL federation error
  5. Verified correct version string is returned

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in the comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally: ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

@somiljain2006
Copy link
Copy Markdown
Contributor Author

somiljain2006 commented Mar 26, 2026

@terrymanu @menghaoranss @taojintianxia @RaigorJiang @strongduanmu @FlyingZC Can you please review this pr?

@strongduanmu
Copy link
Copy Markdown
Member

Hi @somiljain2006, can you add e2e test in db_tbl_sql_federation scenario?

@somiljain2006
Copy link
Copy Markdown
Contributor Author

I think there is some problem with my logic, as after running the e2e test, it shows errors so therefore im marking this pr as draft till i came up with my new logic

@somiljain2006 somiljain2006 marked this pull request as draft March 31, 2026 21:46
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.

SQL Federation (PostgreSQL): SELECT version() got Exception when ALL_QUERY_USE_SQL_FEDERATION=true

2 participants