Re: Using escape strings in an insert statement.

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Erik Jones <erik(at)myemma(dot)com>
Cc: Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Using escape strings in an insert statement.
Date: 2007-07-03 17:56:39
Message-ID: 4A068101-E181-4183-BB4D-44243B344F22@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Jul 3, 2007, at 10:49 , Erik Jones wrote:

> On Jul 2, 2007, at 6:11 PM, Michael Glaesemann wrote:
>
>>
>> On Jul 2, 2007, at 17:45 , Paul Lambert wrote:
>>
>>> tester=# insert into testing (test_text) values ('abcE'\\'123');
>>
>> This should be
>> INSERT INTO testing (test_text) values (E'abc\123');
>
> No, that will leave him with the string 'abc23' beinginserted, he
> wants the backslash to be included in the string, that's why he had
> two, so it should be:
>
> INSERT INTO testing (test_text) values (E'abc\\123');

Ah, right. Thanks for the correction, Erik.

Michael Glaesemann
grzm seespotcode net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bob Singleton 2007-07-03 18:43:31 Iterate and write a previous row to a temp table?
Previous Message Scott Marlowe 2007-07-03 17:48:56 Re: Informix Schema -> PostgreSQL ?