PostgreSQLでnonstandard use of escape警告

PostgreSQLでnonstandard use of escape警告

by Haruhiko Okumura -
Number of replies: 0
Moodle 1.9.xをPostgreSQLで動作させた場合に

postgres[25084]: [2-1] WARNING: nonstandard use of escape in a string literal at character 87
postgres[25084]: [2-2] HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.

のような警告が頻出するというご報告をいただきました。
結局自己解決されたのですが,結果的には
http://lets.postgresql.jp/documents/tutorial/mediawiki/3
に書いてあるように,postgres.confで

escape_string_warning = on

escape_string_warning = off

として警告を抑制したとのことです。本質的には
http://d.hatena.ne.jp/takami_hiroki/20101105
にあるように文字列にEを冠するのがPostgreSQL的には正しい流儀のようです。

本家には報告していませんが,とりあえず。
Average of ratings: お役立ち度: ★★★★★★★ (2)