Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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.


In response to

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group