0

I don't know why error when Postgres SQL run this SQL command:

INSERT INTO "mb_member_points" ("code","value","acc_value","cur_value","cur_acc_value") 
VALUES ('A001132451','-Qyq2\','kL0GSG',1,1);

ERROR: syntax error at or near "kL0GSG" at character 120

table struct

I'm using PostgreSQL 8.1.3, Sequelize 4.44.

Dang Thach Hai
  • 347
  • 3
  • 10
  • Does this answer your question? [Escaping backslash in Postgresql](https://stackoverflow.com/questions/3049034/escaping-backslash-in-postgresql) – Andreas Oct 16 '20 at 04:21
  • I can't reproduce your error. – Tim Biegeleisen Oct 16 '20 at 04:21
  • 1
    Postgres 8.1 has been [unsupported](https://www.postgresql.org/support/versioning/) and unmaintained for nearly a decade. You should plan an upgrade to a supported version now –  Oct 16 '20 at 05:30
  • What is the value of [standard_conforming_strings](https://www.postgresql.org/docs/8.1/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS) in your installation? You should set it to `on` –  Oct 16 '20 at 06:01
  • In my postgresql.config don't have setting "standard_conforming_strings". But I don't want change Postgres setting – Dang Thach Hai Oct 16 '20 at 07:47
  • Can I use this? https://stackoverflow.com/a/22466191/4725750 – Dang Thach Hai Oct 16 '20 at 07:52
  • You can change it for the current connection using `set standard_conforming_strings=on;` or for the current user using `alter user set standard_conforming_strings=on;` –  Oct 16 '20 at 08:41
  • Why are you using such archaic, unsupported software? – Gordon Linoff Oct 16 '20 at 12:21
  • Setting `standard_conforming_strings` will not work in 8.1 as it was read only in that version. An option is to do `E'-Qyq2\'`. – Adrian Klaver Oct 16 '20 at 14:33

0 Answers0