Re: converting text to bytea

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Yambu <hyambu(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: converting text to bytea
Date: 2021-02-25 15:03:07
Message-ID: CAFj8pRAErg6itha5+px9eLhtVy-=p3yG5Kr2JFQzpyaSyGdCvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

čt 25. 2. 2021 v 16:01 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Yambu <hyambu(at)gmail(dot)com> writes:
> > Is there a reason why i'm getting text when i run the below
> > select convert_to('some_text', 'UTF8') i get back 'some_text'
>
> You must have bytea_output set to "escape".
>

yes

set bytea_output TO escape ;
postgres=# select convert_to('žlutý kůň', 'UTF8') ;
┌───────────────────────────────────────┐
│ convert_to │
╞═══════════════════════════════════════╡
│ \305\276lut\303\275 k\305\257\305\210 │
└───────────────────────────────────────┘
(1 row)

> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-02-25 15:06:54 Re: Extension intarray and null values
Previous Message Pavel Stehule 2021-02-25 15:01:14 Re: Deleting takes days, should I add some index?