Re: Entering a character code in a query

From: John Gage <jsmgage(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Cc: "John Gage *EXTERN*" <jsmgage(at)numericable(dot)fr>
Subject: Re: Entering a character code in a query
Date: 2010-03-09 16:04:09
Message-ID: cd15286d1003090804k1d5be8edvb559e906a4e91a5c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would just like to thank Albe and Jasen for their responses. What an
extraordinary environment Postgres is! Human and computing.

On Tue, Mar 9, 2010 at 1:32 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> John Gage wrote:
> > I would like to use the following query:
> >
> > SELECT english || '\n' || english || '\x2028' || french AS
> > output FROM vocab_words_translated;
> >
> > where \x2028 is the hexadecimal code for a soft carriage return.
> >
> > However, this does not work.
> >
> > Can anyone help with this problem?
>
> If you have PostgreSQL 8.4 with standard_conforming_strings = on,
> you could write:
>
> english || E'\n' || english || U&'\2028' || french
>
> Otherwise, you have to resort to
>
> english || E'\n' || english || chr(8232) || french
>
> (provided your server_encoding is UTF8).
>
> Yours,
> Laurenz Albe
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-03-09 16:06:43 Re: How many file descriptors does postgres need?
Previous Message Steve T 2010-03-09 15:55:54 Re: Urgent help needed- alias name in update statement