Re: converting text to bytea

From: Yambu <hyambu(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: converting text to bytea
Date: 2021-02-25 11:31:29
Message-ID: CALhHtcD-dO9hix26VmUt5x+4yqMHxdxWW2f_2ensxgWv9DyVFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

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'

regards

On Mon, Feb 22, 2021 at 9:09 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:

> Hi
>
> po 22. 2. 2021 v 7:37 odesílatel Yambu <hyambu(at)gmail(dot)com> napsal:
>
>> Hello
>>
>> This sounds simple, but im not getting the results when i cast text to
>> bytea like this first_name::bytea . Is there another way to do this?
>>
>
> You should to use convert_to function
>
>
> https://www.postgresql.org/docs/current/functions-binarystring.html#FUNCTIONS-BINARYSTRING-CONVERSIONS
>
> Regards
>
> Pavel
>
>
>> regards
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yi Sun 2021-02-25 12:36:26 Re: Batch update million records in prd DB
Previous Message Bjornar Skinnes 2021-02-24 20:36:50 Re: Slow index creation