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:49:26
Message-ID: 20080328214926.GD6870@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:29:06PM -0400, Terry Lee Tucker wrote:
> Thanks Sam. No, that is not what I tried. I had tried:
> UPDATE bill SET notes = 'blah, blah, yeaE'\n'more stuff.'
> It didn't dawn on me that the E went in front of the whole string!

it's always easy when you know how!

> Thanks for the help...

No probs.

PG 8.3 is also more strict with its automatic casts and you may have
fun there as well. In previous versions, it would be reasonably happy
to (silently) convert lots of datatypes to text. This was generally
useful, but occasionally led to bad things happening. Most times I've
seen people affected by this is with dates---i.e. to get the year some
people did substr(datecol,1,4). In this case you should really be doing
extract(year from datecol) because the year doesn't always have to be in
the first four digits it just tends to be in the common setups.

Sam

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-03-28 21:57:55 Re: Out of memory
Previous Message Terry Lee Tucker 2008-03-28 21:29:06 Re: Escaping \n