X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A472B3A561C for ; Mon, 10 Jan 2005 23:05:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54887-02 for ; Mon, 10 Jan 2005 23:05:19 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id AFE3A3A57AB for ; Mon, 10 Jan 2005 23:05:21 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j0AN5KqQ009596; Mon, 10 Jan 2005 18:05:21 -0500 (EST) To: Luciano Cc: pgsql-odbc@postgresql.org Subject: Re: Query with hexadecimal characters In-reply-to: <20050110221036.62433.qmail@web53703.mail.yahoo.com> References: <20050110221036.62433.qmail@web53703.mail.yahoo.com> Comments: In-reply-to Luciano message dated "Mon, 10 Jan 2005 14:10:36 -0800" Date: Mon, 10 Jan 2005 18:05:20 -0500 Message-ID: <9595.1105398320@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/18 X-Sequence-Number: 4813 Luciano writes: > I am having a problem doing a query with hexadecimal > characters through ODBC. The hexadecimal characters > are inside a character filed. It would be something > like: > SELECT * FROM MYTABLE WHERE COLUMN1 < 'XXXXXX' > but instead of the X's there are x'FF' characters... > The query is accepted, but the result is not > consistent... it returns an empty result set. Does > anyone know if I'm missing something? I suspect you are spitting byte sequences at the backend that are illegal in the character set encoding you've selected. Check your locale and database encoding setup. C/SQL_ASCII is the best bet if you want to pretend that you can store any random byte sequence in a character field. Plan B, which would probably be better in the long run, is to store that data in a bytea field instead, and send escaped characters (ie \\377 rather than an actual FF byte). regards, tom lane