Re: Escaping \n

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Escaping \n
Date: 2008-03-28 21:21:48
Message-ID: 20080328212148.GC6870@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 28, 2008 at 05:06:10PM -0400, Terry Lee Tucker wrote:
> HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
>
> The problem is a line like 'UPDATE bill SET notes = 'blah, blah, yea\nmore
> stuff';
>
> How to I escape the newline embeded in the string? I've tried the advice from
> HINT, but have been unable to get it to work.

The statement would become:

UPDATE bill SET notes = E'blah, blah, yea\nmore stuff';

Is this what you tried? I couldn't tell from your message. If you did,
then maybe your database drivers are somehow mangling the statement
somewhere between your code and the database. You could try running it
locally from inside psql to find out.

Sam

In response to

  • Escaping \n at 2008-03-28 21:06:10 from Terry Lee Tucker

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2008-03-28 21:29:06 Re: Escaping \n
Previous Message Alex Adriaanse 2008-03-28 21:20:01 Re: Out of memory