Skip site navigation (1) Skip section navigation (2)

Re: BUG? res.next() == false, but psql finds tuples?

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Palle Girgensohn <girgen(at)pingpong(dot)net>
Cc: pg(at)fastcrypt(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: BUG? res.next() == false, but psql finds tuples?
Date: 2005-04-22 22:22:50
Message-ID: 4269793A.70508@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Palle Girgensohn wrote:
> --On lördag, april 23, 2005 10.10.28 +1200 Oliver Jowett
> <oliver(at)opencloud(dot)com> wrote:
> 
>> Dave Cramer wrote:
>>
>>> Certainly looks like a bug, in the java version mango is not quoted so
>>> pg thinks it is a column.
>>>
>>> Although I just checked the test cases and we do this all the time ???
>>
>>
>> The (lack of) quoting is a red herring, it's just how our
>> PreparedStatement.toString() is implemented. The actual query sent uses
>> $1/$2 as you can see in the tcpdump.
> 
> 
> Is there a way to mimic this behaviour, i.e. using a prepared statement
> with $1/$2, in psql?

You could use PREPARE/EXECUTE which is similiar if not identical. From
memory:

  PREPARE foo(int,varchar) AS SELECT ... $1 ... $2 ...;
  EXECUTE foo(42, "bar");

-O

In response to

pgsql-jdbc by date

Next:From: Tom LaneDate: 2005-04-22 22:24:07
Subject: Re: BUG? res.next() == false, but psql finds tuples?
Previous:From: Palle GirgensohnDate: 2005-04-22 22:13:08
Subject: Re: BUG? res.next() == false, but psql finds tuples?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group