Re: Entering a character code in a query - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Entering a character code in a query
Date
Msg-id D960CB61B694CF459DCFB4B0128514C2039381E5@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Entering a character code in a query  (John Gage <jsmgage@numericable.fr>)
Responses Re: Entering a character code in a query  (John Gage <jsmgage@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Libpq: copy file to bytea column
Next
From: "Scot Kreienkamp"
Date:
Subject: Re: autovacuum question