Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4eZH-0003A5-2F for pgsql-general@arkaria.postgresql.org; Sun, 09 Aug 2020 06:12:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k4eZF-0002qD-Ez for pgsql-general@arkaria.postgresql.org; Sun, 09 Aug 2020 06:12:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4eZF-0002q6-3B for pgsql-general@lists.postgresql.org; Sun, 09 Aug 2020 06:12:25 +0000 Received: from stz-bg.com ([2a02:6800:0:99::2] helo=mail.stzbg.com) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k4eZ8-0002Nm-A6 for pgsql-general@lists.postgresql.org; Sun, 09 Aug 2020 06:12:22 +0000 Received: from www.stz-bg.com (stz-bg.com [IPv6:2a02:6800:0:99::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: condor@stz-bg.com) by mail.stzbg.com (Postfix) with ESMTPSA id CCFE42E0752 for ; Sun, 9 Aug 2020 09:12:15 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stz-bg.com; s=mail; t=1596953536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zx377RH6qEfB5PZS+jhpBIxiXW+5ApLKDXdAFe1b0bA=; b=Jh56nsXXgLol/E8dyT1fBkauHgjbxhJQASDfIpDU6QODNr96Gjb0W46Rwmq2IpzBLG6cj6 N0myYVU4i0GGqMZMmr0PbtZ8aLrwqRqYrXg/UK2DaSkbrGvbwxTuTQ7xyaC8MXFIax/ZEf PnpfAmn81UhBmNyKB1KL5cBig8wTJiE= MIME-Version: 1.0 Date: Sun, 09 Aug 2020 09:12:14 +0300 From: Condor To: pgsql-general@lists.postgresql.org Subject: Need help how to reproduce MySQL binary to PosgreSQL User-Agent: Roundcube Webmail/1.4.7 Message-ID: <6ba79f0a4d46b6298b14749369df538a@stz-bg.com> X-Sender: condor@stz-bg.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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