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 677173A5151 for ; Tue, 11 Jan 2005 02:36:27 +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 79409-06 for ; Tue, 11 Jan 2005 02:36:14 +0000 (GMT) Received: from web53708.mail.yahoo.com (web53708.mail.yahoo.com [206.190.37.29]) by svr1.postgresql.org (Postfix) with SMTP id 150B83A5838 for ; Tue, 11 Jan 2005 02:36:16 +0000 (GMT) Received: (qmail 17299 invoked by uid 60001); 11 Jan 2005 02:36:16 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=sdh9iZSpAEfuV5JEM0qb9fPTbNQ93dN4Fzr92Z4V+/sa9DNFy+d2UZdd5Vcto3MR/JA5iJIgTAcSlX4lhWduxhifqyhyFkaVthWbfWdADvj/XhT+oeBeH7/yj7kplXvASzFXOzGNkWMWHNgoNPfGkQO3wVYmH4GeN8MQZug0MBQ= ; Message-ID: <20050111023616.17297.qmail@web53708.mail.yahoo.com> Received: from [24.232.234.253] by web53708.mail.yahoo.com via HTTP; Mon, 10 Jan 2005 18:36:16 PST Date: Mon, 10 Jan 2005 18:36:16 -0800 (PST) From: Luciano Subject: Re: Query with hexadecimal characters To: pgsql-odbc@postgresql.org In-Reply-To: <9595.1105398320@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200501/19 X-Sequence-Number: 4814 Eric and Tom: thank you very much for your help, I will try your suggestions tomorrow at work. The sql statements are issued from a COBOL program, which can also issue the same statements to other databases (MySQL, MS SQLServer), so the first thing Im going to do is trying to change the encoding setup, which would be the most homogeneous solution that wouldn't interfere with the other databases, that currently handle well those strings with hexadecimal data. Thank u very much again! Luciano. --- Tom Lane wrote: > 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 > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend > __________________________________ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250