Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 226D39FA5A0 for ; Mon, 2 Jul 2007 19:45:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 00222-09 for ; Mon, 2 Jul 2007 19:45:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from rrmailscan3.safenetbox.biz (mailscan3.reynolds.com.au [203.25.40.75]) by postgresql.org (Postfix) with ESMTP id 03D779FA2B2 for ; Mon, 2 Jul 2007 19:45:22 -0300 (ADT) Received: from rrmailscan3.safenetbox.biz (rrmailscan3.safenetbox.biz [127.0.0.1]) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id 1BDB31D4842E for ; Tue, 3 Jul 2007 08:45:21 +1000 (EST) Received: from [127.0.0.1] (online4-new.lnk.telstra.net [139.130.169.227]) (Authenticated sender: remote) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id 65E8C1D48424 for ; Tue, 3 Jul 2007 08:45:20 +1000 (EST) Message-ID: <46898000.7030601@autoledgers.com.au> Date: Tue, 03 Jul 2007 06:45:20 +0800 From: Paul Lambert User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Using escape strings in an insert statement. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/6 X-Sequence-Number: 28741 I'm having a little glitch in using escape strings within strings. The following will best explain my issue: tester=# create table testing (test_text text); CREATE TABLE tester=# insert into testing (test_text) values ('abc\\123'); WARNING: nonstandard use of \\ in a string literal LINE 1: insert into testing (test_text) values ('abc\\123'); ^ HINT: Use the escape string syntax for backslashes, e.g., E'\\'. INSERT 0 1 ^^^ This works, but I still get an error/warning telling me to use E'\\' - which I do: tester=# insert into testing (test_text) values ('abcE'\\'123'); Invalid command \. Try \? for help. tester(# ^^^ And this just doesn't work at all. The help itself (ch 4.1.2.1) tells me to use double backslash "Thus, to include a backslash character, write two backslashes (\\). " Which one is the correct syntax and how can I make it not return anything other than a successful insert? Noob question, I know... But TIA. (Version is 8.2.3 on Weenblowz if that is of any relevance) -- Paul Lambert Database Administrator AutoLedgers