Add integer_datetimes flag in connection parameters status, hardcoded to on#5103
Add integer_datetimes flag in connection parameters status, hardcoded to on#5103renecannao merged 1 commit intov3.0from
Conversation
…ded to on. Added scram_iterations in ProxySQL staup parameters status, hardcoded to 4096 (SCRAM_SHA_256_DEFAULT_ITERATIONS)
There was a problem hiding this comment.
Summary of Changes
Hello @rahim-kanji, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates how ProxySQL communicates PostgreSQL server parameters to connecting clients. It ensures that the integer_datetimes flag is always reported as "on", aligning with PostgreSQL versions 10 and newer which exclusively use 64-bit integer representation for date/time values. Additionally, it introduces the scram_iterations parameter, providing clients with the default iteration count for SCRAM authentication. These changes improve compatibility and correct parameter reporting for PostgreSQL clients.
Highlights
- PostgreSQL integer_datetimes flag: The integer_datetimes parameter status is now explicitly set to "on" during client welcome, reflecting modern PostgreSQL's default behavior where date/time values are always represented as 64-bit integers.
- SCRAM Iterations: The scram_iterations parameter status is now explicitly set to "4096" during client welcome.
- Code Cleanup: Removed previously commented-out code related to client_encoding and datestyle parameter status writes.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
|
There was a problem hiding this comment.
Code Review
This pull request adds the integer_datetimes and scram_iterations startup parameters. The change for integer_datetimes is correct and aligns with modern PostgreSQL behavior. The implementation for scram_iterations uses a magic number, which could be a maintainability issue. I've added a review comment with a suggestion to improve this.
| // using SCRAM_SHA_256_DEFAULT_ITERATIONS value | ||
| pgpkt.write_ParameterStatus("scram_iterations", "4096"); |
There was a problem hiding this comment.
The hardcoded value "4096" is a magic number. This value corresponds to SCRAM_DEFAULT_ITERATIONS from libscram. If that constant ever changes, this hardcoded value will become stale, which could lead to authentication issues for clients that rely on this parameter. It would be better to define and use a constant for this value.
Also, the comment is slightly inaccurate. The constant in libscram is SCRAM_DEFAULT_ITERATIONS.
// Report scram_iterations. This corresponds to SCRAM_DEFAULT_ITERATIONS from libscram.
pgpkt.write_ParameterStatus("scram_iterations", "4096");


Details
integer_datetimesflag.integer_datetimesis always compiled as on (64-bit integer). The GUC still exists but is fixed to on and cannot be disabled.Closes #5100