Skip to content

Skip standard_conforming_strings=off specs on PostgreSQL-19 - #755

Merged
larskanis merged 1 commit into
ged:masterfrom
yahonda:pg19-standard-conforming-strings
Oct 19, 2026
Merged

larskanis merged 1 commit into
ged:masterfrom
yahonda:pg19-standard-conforming-strings

Conversation

@yahonda

@yahonda yahonda commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

PostgreSQL-19 forces standard_conforming_strings to always be on and removes escape_string_warning.
Running the specs against a PostgreSQL-19 server, the embed_params specs fail because with_std_conf_strings switches these settings:

SET standard_conforming_strings = off
ERROR:  non-standard string literals are not supported

SET escape_string_warning = off
ERROR:  unrecognized configuration parameter "escape_string_warning"

The "on" variants fail too, since they also SET escape_string_warning = on.

Changes

with_std_conf_strings checks conn.server_version. On PostgreSQL-19 and later it skips the "off" variants and runs the "on" variants without changing any settings. Older servers keep the current behavior.

How this was tested

CI does not run against PostgreSQL-19 yet. I tested this with PostgreSQL 19rc1 by adding it to the source-gem.yml matrix (not included in this pull request):

--- a/.github/workflows/source-gem.yml
+++ b/.github/workflows/source-gem.yml
@@ -57,6 +57,9 @@ jobs:
           - os: ubuntu
             ruby: "head"
             PGVER: "18"
+          - os: ubuntu
+            ruby: "head"
+            PGVER: "19"
           - os: ubuntu
             ruby: "3.3"
             PGVER: "12"

All jobs passed, and the PostgreSQL-19 job reports 1159 examples, 0 failures, with the 4 "off" variants pending: https://github.com/yahonda/ruby-pg/actions/runs/39204891098

PostgreSQL-19 forces standard_conforming_strings to always be on and
removes escape_string_warning, so the embed_params specs that switch
these settings fail:

    SET standard_conforming_strings = off
    ERROR:  non-standard string literals are not supported

    SET escape_string_warning = off
    ERROR:  unrecognized configuration parameter "escape_string_warning"

Skip the "off" variants on PostgreSQL-19 and run the "on" variants
without changing the settings.

https://www.postgresql.org/docs/19/release-19.html#RELEASE-19-MIGRATION
postgres/postgres@4576208

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@larskanis

Copy link
Copy Markdown
Collaborator

Thank you very much! I already noticed this change, but didn't take an action so far.

@larskanis
larskanis merged commit 8c88432 into ged:master Oct 19, 2026
35 checks passed
@yahonda
yahonda deleted the pg19-standard-conforming-strings branch October 19, 2026 07:33
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