Unix Technical Forum

Re: Query with hexadecimal characters

This is a discussion on Re: Query with hexadecimal characters within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> Luciano <ldelio@yahoo.com> writes: > I am having a problem doing a query with hexadecimal > characters through ODBC. The ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 01:01 AM
Tom Lane
 
Posts: n/a
Default Re: Query with hexadecimal characters

Luciano <ldelio@yahoo.com> 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:33 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com