pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Matt Van Mater <nutter_@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: how to preserve \n in select statement
Date: Fri, 19 Dec 2003 15:26:07 -0600
Message-ID: <20031219212607.GB14968@wolff.to> (raw)
In-Reply-To: <BAY9-F53yNIKFVlAbTy00003a01@hotmail.com>
References: <BAY9-F53yNIKFVlAbTy00003a01@hotmail.com>

On Fri, Dec 19, 2003 at 10:06:28 -0500,
  Matt Van Mater <nutter_@hotmail.com> wrote:
> I have a table that has a few text value types, and I enter a bunch of text 
> with '\n' representing a newline.  When I select the records from that 
> table, postgresql 7.3 represents those \n as newlines and actually outputs 
> the a newline rather than as a \n as entered.  I want to be able to get my 
> \n text out of the select statement in the exact same manner it was 
> inserted.

If you really want to store \n so that something else will interpret \n
as a newline, then use '\\n' in the string constant.



view thread (11+ messages)  latest in thread

Message-ID: <20031219212607.GB14968@wolff.to>
Permalink:  ../20031219212607.GB14968@wolff.to/
Also on:    postgresql.org/message-id/20031219212607.GB14968@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, nutter_@hotmail.com
  Subject: Re: how to preserve \n in select statement
  In-Reply-To: <20031219212607.GB14968@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox