Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea

From: Vincent D'Haene <vincent_dhaene(at)hotmail(dot)com>
To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea
Date: 2008-02-20 09:42:34
Message-ID: BAY124-W30C98FDFA2B98F8DBE8860FE230@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gevik,

The link didn't help because that is not the same problem as I have:

My problem is that it seems that in postgresql you can't use a parameter bound to BYTEA data in the WHERE clause of the SQL statement.

So in my case: "SELECT x FROM T WHERE BinData = ?" does not work (return code -1) if the parameter bound to the ? is of type BYTEA.

Vincent

> From: pgdev(at)xs4all(dot)nl
> To: vincent_dhaene(at)hotmail(dot)com; pgsql-bugs(at)postgresql(dot)org
> Subject: RE: [BUGS] BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea
> Date: Sun, 10 Feb 2008 23:09:16 +0100
>
> perhaps this helps
>
> http://www.webservertalk.com/archive308-2007-3-1836413.html
>
>
> > -----Original Message-----
> > From: pgsql-bugs-owner(at)postgresql(dot)org
> > [mailto:pgsql-bugs-owner(at)postgresql(dot)org] On Behalf Of vha
> > Sent: Sunday, February 10, 2008 7:55 PM
> > To: pgsql-bugs(at)postgresql(dot)org
> > Subject: [BUGS] BUG #3951: SELECT ... WHERE Param = ? does
> > not work if Param is of type bytea
> >
> >
> > The following bug has been logged online:
> >
> > Bug reference: 3951
> > Logged by: vha
> > Email address: vincent_dhaene(at)hotmail(dot)com
> > PostgreSQL version: 8.3
> > Operating system: Windows XP SP2
> > Description: SELECT ... WHERE Param = ? does not work
> > if Param is of
> > type bytea
> > Details:
> >
> > I have a table with one of the columns of type BYTEA
> > containing GUIDs (16 bytes of data).
> >
> > The data of the column is specified using
> > SQLBindParameter(hstmt, nCol, SQL_PARAM_INPUT, SQL_C_BINARY,
> > SQL_BINARY, 16, 0, theGUID, 16, &ptr).
> >
> > This works fine to insert the data using "INSERT ... VALUES
> > ?", but retrieving the data using "SELECT ... WHERE Param =
> > ?" doesn't work: nothing is returned.
> >
> > Am I doing something wrong or is this a bug?
> >
> > BTW. This code works without any problem on MS SQL 2000, MS
> > SQL 2005, Oracle and MySQL.
> >
> >
> > vha
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 1: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org
> > so that your
> > message can get through to the mailing list cleanly
> >
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jacky Leng 2008-02-20 09:53:20 GetNewOidWithIndex can cause infinite loop on user tables(not catalog).
Previous Message Gregory Stark 2008-02-20 09:26:35 Re: BUG #3965: UNIQUE constraint fails on long column values