Re: Need help how to reproduce MySQL binary to PosgreSQL

From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Condor <condor(at)stz-bg(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Need help how to reproduce MySQL binary to PosgreSQL
Date: 2020-08-09 06:20:13
Message-ID: CAG7mmoz6w--5wmt1JW35fYp4+y_GRBNJ3ijd2wq-GKKNP8QhEg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Have you checked this?
https://stackoverflow.com/questions/44813386/mysqls-hex-and-unhex-equivalent-in-postgres

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

On Sun, Aug 9, 2020 at 11:42 AM Condor <condor(at)stz-bg(dot)com> wrote:

>
> Hello,
>
> how I can reproduce MySQL binary to PosgreSQL and use follow
> functionality in PG.
>
> On mysql I have table with 3 fields:
>
> CREATE TABLE table (
> user_id int,
> user_info binary(4),
> user_data binary(16)
> );
>
> then I use them for example:
>
> UPDATE table set user_info = CHAR(0, 2, 0, 0), user_data = CHAR(123, 1,
> 0, 2) WHERE user_id = 1;
>
> select and insert them as:
>
> SELECT HEX(user_info) AS user_info, HEX(user_data) AS user_data FROM
> table;
> INSERT INTO table (user_info, user_data) VALUES
> (UNHEX(hexdata_commng_from_app), UNHEX(hexdata_commng_from_app));
>
> I check PG does not have functions HEX and UNHEX. Some one can help a
> little ?
>
> Regards,
> HS
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Condor 2020-08-09 11:49:49 Re: Need help how to reproduce MySQL binary to PosgreSQL
Previous Message Condor 2020-08-09 06:12:14 Need help how to reproduce MySQL binary to PosgreSQL