pg_duckdb
pg_duckdb copied to clipboard
`standards_conforming_strings=off` confuses duckdb parser
postgres=# set standard_conforming_strings =off;
SET
postgres=# select * from foo where t = 'foo\'bar';
WARNING: nonstandard use of \' in a string literal
LINE 1: select * from foo where t = 'foo\'bar';
^
HINT: Use '' to write quotes in strings, or use the escape string syntax (E'...').
WARNING: (DuckDB) Parser Error: syntax error at or near "bar"
LINE 1: select * from foo where t = 'foo\'bar';
^
ERROR: unrecognized node type: 1
@wuputah @hlinnaka What do you think the best way to fix this issue?
- support
standards_conforming_stringsinduckdbfor compatible. -> I see tThe purpose of this guc is to be compatible with the behavior of old versions of postgres. Maybe it's not good idea to do this. - handle this logic in the pg_duckdb. Do some pre-process in the pg_duckdb.
- forbid to use the duckdb when we find we use this GUC.
A general question is what is the general approach for some GUCs that may change behavior or be incompatible with duckdb, or is it handled on a case-by-case?
This is now fixed by #130, I now added a test for this in #135