Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refine the session variables accessing (#193) #226

Merged
merged 8 commits into from
Nov 29, 2024
Merged

Conversation

VWagen1989
Copy link
Contributor

@VWagen1989 VWagen1989 commented Nov 27, 2024

This PR addresses the modification and retrieving problems of session variables under PostgreSQL protocol. I've ported the implementation of managing system variables of PostgreSQL from doltgresql. And now MyDuck server have all the PostgreSQL system variables.

In addition, this PR also solve these problems:

  • Implementing the query intercepter that captures SET statement, RESET statement, SHOW statement and query on the function current_setting(). Both the system variables for PostgreSQL and DuckDB can be accessed as expected. P.S. SHOW ALL and RESET ALL are not supported yet.
  • The statements listed above can be handled successfully under both simple query and extended query. Please see the test in pgserver/sess_params_test.go.

config/duck_config.go Outdated Show resolved Hide resolved
pgserver/connection_handler.go Outdated Show resolved Hide resolved
pgserver/connection_handler.go Outdated Show resolved Hide resolved
pgserver/duck_handler.go Outdated Show resolved Hide resolved
pgserver/connection_handler.go Outdated Show resolved Hide resolved
pgserver/connection_handler.go Outdated Show resolved Hide resolved
pgserver/connection_handler.go Outdated Show resolved Hide resolved
@VWagen1989 VWagen1989 enabled auto-merge (squash) November 28, 2024 16:38
Copy link
Collaborator

@fanyang01 fanyang01 left a comment

Choose a reason for hiding this comment

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

LGTM! This PR improve our PG compatibility a lot since many client libraries get/set the PG parameters on their first connection.

@VWagen1989 VWagen1989 merged commit ab8a581 into main Nov 29, 2024
8 checks passed
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.

2 participants