Escaping literal strings in pg_8.4 - Mailing list pgsql-novice

From Ennio-Sr
Subject Escaping literal strings in pg_8.4
Date
Msg-id 20120412174508.GA32586@deby.ei.hnet
Whole thread Raw
Responses Re: Escaping literal strings in pg_8.4  (Willy-Bas Loos <willybas@gmail.com>)
List pgsql-novice
Hi all!

[using postgresql_8.4 under debian/GNU-Linux 2.6.32]

I'm trying to understand how the escape_string is supposed to work.
After writing a file ('prova12000.memo')  with this single line:
-----
Vediamo se quest''altro E'\r\n' lo riconosce come un a capo E'\r\n' e questo dovrebbe essere il nuovo rigo: ''bla bla
bla''!
-----
entered the command:

$ psql mydb -c "insert into bibl_memos values(12000, '`cat prova12000.memo`');"

and got:

ERROR:  syntax error at or near "\"
LINE 1: ...bl_memos values(12000, 'Vediamo se quest''altro E'\r\n' lo r...
                                                             ^
Both the lines 'escape_string_warning=on' and 'standard_conforming_strings=off' are commented out in postgresql.conf.

Could somebody please explain what is going wrong?

Thanks for your attention. Regards,
          ennio
--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!"  (diceva Henry Miller) ]    (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.              )=(
 Do something you aren't good at!" (as Henry Miller used to say) ]

pgsql-novice by date:

Previous
From: Bob McConnell
Date:
Subject: Switching python app from sqlite to postgres
Next
From: keshav dixit
Date:
Subject: Service start up error "The Service name is invalid net helpmsg 2185"