Re: Can we remove support for standard_conforming_strings = off yet?
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2025-12-31T16:02:36Z
Lists: pgsql-hackers
On 2025-12-30 Tu 5:50 PM, Tom Lane wrote: > I wrote: >> standard_conforming_strings has defaulted to ON since 2010 (see >> 0839f312e in the 9.1 release). I propose that it's finally time to >> force it on and get rid of code that supports the "off" setting. > Here's a draft patch series for that. > > As I was working through it, I realized that there's one > potentially-nasty point that might cause upgrading problems. > To wit, pg_dump and pg_dumpall have historically replicated the > source server's standard_conforming_strings setting into their > output: they emit a SET command for that, and any string literals > appearing in views or the like will be escaped accordingly. > So if your old installation had standard_conforming_strings = off, > and all you have from it is existing pg_dump output (either text > or archive format), you are in a sticky situation because that > dump will not restore cleanly. This isn't impossible to get > out of, but you'd probably have to stand up a pre-v19 server, > restore the dump into that, and take a fresh dump made with > standard_conforming_strings = on. The alternative would be > manual correction of literals in the dump script, which seems > far too error-prone to be recommendable. Have we ever promised that dumps made using pg_dump/pg_dumpall from other than the target version work? I don't see this as a big issue, unless I'm misunderstanding. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com