patternsqlMinor
Postgres 9.3 changes the standard_conforming_strings value
Viewed 0 times
standard_conforming_stringsthepostgresvaluechanges
Problem
I'm migrating a legacy application's database from Postgres 8.1 to Postgres 9.3
In order to avoid compatibility issues, I'd like to keep the
So, I create the databases using following in the schema:
But a pg_dump of the database reveals that Postgres has changed the value to
How can I prevent this?
In order to avoid compatibility issues, I'd like to keep the
standard_conforming_strings parameter to it's default value in 8.1: off.So, I create the databases using following in the schema:
SET standard_conforming_strings = off;But a pg_dump of the database reveals that Postgres has changed the value to
on.SET standard_conforming_strings = on;How can I prevent this?
Solution
How exactly did you set
If you did that in your session, it only applies to that session. For a permanent setting change your
Also, a
Or get more details from
Generally, it's a very bad idea to try and keep
standard_conforming_strings?If you did that in your session, it only applies to that session. For a permanent setting change your
postgresql.conf and reload.Also, a
pg_dump does not reveal anything. The setting in the dump only applies to the dump. To see the current setting of your database, run:SHOW standard_conforming_strings;Or get more details from
pg_settings:SELECT * FROM pg_settings WHERE name = 'standard_conforming_strings';Generally, it's a very bad idea to try and keep
standard_conforming_strings off. This was changed with Postgres 9.1 for a good reason. It's going to bite you sooner or later. Update to the current (superior) standard.Code Snippets
SHOW standard_conforming_strings;SELECT * FROM pg_settings WHERE name = 'standard_conforming_strings';Context
StackExchange Database Administrators Q#71681, answer score: 4
Revisions (0)
No revisions yet.