pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Condor <condor@stz-bg.com>
To: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Need help how to reproduce MySQL binary to PosgreSQL
Date: Sun, 09 Aug 2020 14:49:49 +0300
Message-ID: <1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com> (raw)
In-Reply-To: <CAG7mmoz6w--5wmt1JW35fYp4+y_GRBNJ3ijd2wq-GKKNP8QhEg@mail.gmail.com>
References: <6ba79f0a4d46b6298b14749369df538a@stz-bg.com>
	<CAG7mmoz6w--5wmt1JW35fYp4+y_GRBNJ3ijd2wq-GKKNP8QhEg@mail.gmail.com>

On 09-08-2020 09:20, Ashesh Vashi wrote:
> 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 [1]
> 
> _http://www.linkedin.com/in/asheshvashi_ [2]
> 
> On Sun, Aug 9, 2020 at 11:42 AM Condor <condor@stz-bg.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
> 
> 

Yea, I checked it, but because is 3 years old solution I expect these 
functions to be implemented long ago and just have another names or to 
have similar functions that do the same functionality. It's seems not, 
Okay will use the solution from sof.

Regards,
HS





view thread (4+ messages)  latest in thread

Message-ID: <1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com>
Permalink:  ../1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com/
Also on:    postgresql.org/message-id/1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: condor@stz-bg.com, ashesh.vashi@enterprisedb.com
  Subject: Re: Need help how to reproduce MySQL binary to PosgreSQL
  In-Reply-To: <1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com>
  References: <6ba79f0a4d46b6298b14749369df538a@stz-bg.com> <CAG7mmoz6w--5wmt1JW35fYp4+y_GRBNJ3ijd2wq-GKKNP8QhEg@mail.gmail.com> <1f30d97d75f41e09f64a23a5e49dfa1f@stz-bg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox