X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 41EE347610C for ; Sat, 10 May 2003 10:22:24 -0400 (EDT) Received: from post.webmailer.de (natsmtp00.webmailer.de [192.67.198.74]) by postgresql.org (Postfix) with ESMTP id 1A9FE475F00 for ; Sat, 10 May 2003 10:21:23 -0400 (EDT) Received: from iwate.ianb.homelinux.net (pD951768F.dip.t-dialin.net [217.81.118.143]) by post.webmailer.de (8.12.8/8.8.7) with ESMTP id h4AELFhj009412 for ; Sat, 10 May 2003 16:21:16 +0200 (MEST) From: Ian Barwick To: pgsql-sql@postgresql.org Subject: Using psql to insert character codes Date: Sat, 10 May 2003 16:20:24 +0200 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200305101620.24605.barwick@gmx.net> X-Spam-Status: No, hits=-11.7 required=5.0 tests=BAYES_01,NO_DNS_FOR_FROM,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/191 X-Sequence-Number: 13356 Say using psql I wish to insert a character into a VARCHAR / TEXT / whateve= r=20 column using the its hexadecimal representation in the relevant character s= et / encoding. E.g.: C3A4, which represents the character '=C3=A4' (lower case= a with=20 umlaut) in UTF-8. I can do this: INSERT INTO my_tbl (unitxt) VALUE(encode(decode('c3a4','hex'), 'escape')) Is there any other, shorter way of doing the same? Ian Barwick barwick@gmx.net