X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 586424763DF for ; Wed, 14 May 2003 17:19:06 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 56308-04 for ; Wed, 14 May 2003 17:19:05 -0400 (EDT) Received: from post.webmailer.de (natsmtp01.webmailer.de [192.67.198.81]) by postgresql.org (Postfix) with ESMTP id 8C3264758C9 for ; Wed, 14 May 2003 17:19:04 -0400 (EDT) Received: from iwate.ianb.homelinux.net (pD9EB1493.dip.t-dialin.net [217.235.20.147]) by post.webmailer.de (8.12.8/8.8.7) with ESMTP id h4ELJ18H025783; Wed, 14 May 2003 23:19:02 +0200 (MEST) From: Ian Barwick To: Peter Eisentraut Subject: Re: Using psql to insert character codes Date: Wed, 14 May 2003 23:18:07 +0200 User-Agent: KMail/1.5.1 Cc: pgsql-sql@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200305142318.07595.barwick@gmx.net> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/301 X-Sequence-Number: 13466 On Sunday 11 May 2003 18:54, Peter Eisentraut wrote: > Ian Barwick writes: > > 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? > > Use octal escapes: '\303\244'; Aha, thanks. That seems to imply though that this statement in the docs: "...where xxx is an octal number, is the character with the corresponding ASCII code." http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=sql-syntax.html is not completely correct. Maybe it should read something like: "...where xxx is an octal number which corresponds to a valid character in the database encoding." Ian Barwick barwick@gmx.net