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

Added support for PG(v.16.1) #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LevNikolaev
Copy link

Dear pg_store_plans Development Team,

I am pleased to submit this pull request, which brings forward compatibility updates and enhancements for PostgreSQL version 16.1, along with modifications for better support when building with cassert. Below, I have detailed the key changes made:

  1. Conditional Compilation Adaptation for PostgreSQL 16.1:

    • Updated conditional compilation checks in pg_store_plans.c. These modifications extend support to PostgreSQL 16.1, ensuring the codebase remains compatible with the latest PostgreSQL version.
  2. Header File Path Adjustments for PostgreSQL 16.1:

    • Incorporated new include paths (e.g., #include "nodes/queryjumble.h"), aligning with the changes in PostgreSQL 16.1’s directory structure and APIs.
  3. Variable Initializations for cassert Compatibility:

    • Adjusted the initialization of several static integer variables (track_level, plan_format, and plan_storage). These were previously uninitialized, potentially causing issues when building with cassert, as it necessitates all variables to be initialized to ensure robust error checking. I have set their default values to 1, aligning with the expected default behavior of the system.
    • This change enhances the stability of the module, especially in debug builds where cassert is commonly enabled, and ensures predictable behavior across different builds and environments.
  4. JSON and YAML Processing Function Modifications:

    • Altered JSON and YAML processing functions to be compatible with PostgreSQL 16.1’s updated behavior and API requirements. This ensures that the module's functionality concerning JSON and YAML processing remains stable and consistent with the latest PostgreSQL standards.
  5. Cleaning Up Outdated Conditional Compilations:

    • Removed conditional compilation directives that were specific to older PostgreSQL versions. This streamlines the codebase, making it more maintainable and easier to understand, while focusing support on more recent PostgreSQL versions.

The primary motivation behind these changes is to ensure that pg_store_plans stays up-to-date with the latest PostgreSQL release, while also addressing build compatibility issues when using cassert. This will not only benefit environments where strict error checking is required but also contribute to the overall reliability of the software.

I hope these updates will be valuable to the pg_store_plans project, and I am keen to discuss any aspects of this pull request or make further modifications if required.

Thank you for considering these enhancements.

Best regards,
Lev Nikolaev,
Tantor Labs

@LevNikolaev
Copy link
Author

Dear pg_store_plans Development Team,

I am excited to present an update to my previous pull request, incorporating additional enhancements and necessary modifications for PostgreSQL version 16.1. These changes not only ensure compatibility but also introduce new requirements for the build process under PostgreSQL 16. Below, I have detailed the new key changes along with a summary of the previous updates:

New Changes:

  1. Significant Updates in Makefile for PostgreSQL 16 Support:

    • Enhanced the Makefile to incorporate logic for PostgreSQL 16 detection and support. This includes a conditional check for the PostgreSQL version to correctly configure the build process for this version.
    • Introduced conditional blocks that verify if PostgreSQL 16 is installed. If detected, additional compile flags (PG_CPPFLAGS) are set, targeting the use of appropriate PostgreSQL source directories.
    • Implemented checks for the presence of the PostgreSQL source code path (PATH_TO_SOURCE_CODE) and the gram.h file within the specified directory. This is critical for building with PostgreSQL 16, especially in light of changes in internal structure and API.
  2. Requirement of PostgreSQL Source Code for Building:

    • Specified that compiled PostgreSQL source code is required for building the extension with PostgreSQL 16, due to dependencies on certain internal header files and structures.
  3. Path Adjustments in pgsp_json.c:

    • Altered the include path for gram.h in pgsp_json.c, reflecting the new directory structure of PostgreSQL 16.

Summary of Previous Updates:

  • Conditional Compilation Adaptation for PostgreSQL 16.1.
  • Header File Path Adjustments for PostgreSQL 16.1.
  • Variable Initializations for cassert Compatibility.
  • Modifications to JSON and YAML Processing Functions.
  • Removal of Outdated Conditional Compilations.

The overarching goal of these comprehensive updates is to ensure that pg_store_plans remains compatible with the latest PostgreSQL release, while addressing the new build requirements introduced in PostgreSQL 16. These changes aim to enhance the extension's robustness and adaptability across various build environments.

I hope these additional modifications will be beneficial to the pg_store_plans project. I am open to discussing any aspects of these changes and am ready to make further adjustments as needed.

Thank you for considering these enhancements to the project.

Best regards,
Lev Nikolaev,
Tantor Labs

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.

None yet

1 participant