pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC and the hstore ? operator - no longer working with build 1211
16+ messages / 6 participants
[nested] [flat]

* JDBC and the hstore ? operator - no longer working with build 1211
@ 2016-10-31 21:07 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Thomas Kellerer @ 2016-10-31 21:07 UTC (permalink / raw)
  To: pgsql-jdbc

The support for using the hstore ? operator without a PreparedStatement worked with build 1208, but is broken (again) with build 1211

The following works with build 1208

   Connection conn = DriverManager.getConnection(...);
   Statement stmt = conn.createStatement();
   ResultSet rs = stmt.executeQuery("select * from some_table where hstore_column ? 'foo');

with build 1211 it throws an exception with the message:

    org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"

Was this intended to work in build 1208 or was that just by accident?

Thomas






-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
@ 2016-11-01 13:53 ` Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Dave Cramer @ 2016-11-01 13:53 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

Thomas,

This has been "broken" for a while now, you have to use ?? to get it to
work.

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 31 October 2016 at 17:07, Thomas Kellerer <spam_eater@gmx.net> wrote:

> The support for using the hstore ? operator without a PreparedStatement
> worked with build 1208, but is broken (again) with build 1211
>
> The following works with build 1208
>
>   Connection conn = DriverManager.getConnection(...);
>   Statement stmt = conn.createStatement();
>   ResultSet rs = stmt.executeQuery("select * from some_table where
> hstore_column ? 'foo');
>
> with build 1211 it throws an exception with the message:
>
>    org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"
>
> Was this intended to work in build 1208 or was that just by accident?
>
> Thomas
>
>
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
@ 2016-11-01 14:00   ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2017-03-02 08:54     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 2 replies; 16+ messages in thread

From: Vladimir Sitnikov @ 2016-11-01 14:00 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

>This has been "broken" for a while now, you have to use ?? to get it to
work.

Dave, that's wrong answer.

The particular regression of "unable to use ? in simple, non-prepared
statement" has already been fixed in master and it has not yet released.

I suggest we should cut 1212 as of now, and consider other PRs for 1213

Thomas, can you please confirm that the issue is not there in
9.4.1212-SNAPSHOT?

Vladimir

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@ 2016-11-01 14:03     ` Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 1 reply; 16+ messages in thread

From: Dave Cramer @ 2016-11-01 14:03 UTC (permalink / raw)
  To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

On 1 November 2016 at 10:00, Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
wrote:

> >This has been "broken" for a while now, you have to use ?? to get it to
> work.
>
> Dave, that's wrong answer.
>

Vladimir, Thanks for correcting me.

>
> The particular regression of "unable to use ? in simple, non-prepared
> statement" has already been fixed in master and it has not yet released.
>
> I suggest we should cut 1212 as of now, and consider other PRs for 1213
>
> Thomas, can you please confirm that the issue is not there in
> 9.4.1212-SNAPSHOT?
>

as soon as you do we can release 1212

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

>
> Vladimir
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
@ 2016-11-01 15:27       ` Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 15:51         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
  2016-11-01 22:47         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
  0 siblings, 2 replies; 16+ messages in thread

From: Thomas Kellerer @ 2016-11-01 15:27 UTC (permalink / raw)
  To: pgsql-jdbc

Dave Cramer schrieb am 01.11.2016 um 15:03:
>     I suggest we should cut 1212 as of now, and consider other PRs for 1213
>
>     Thomas, can you please confirm that the issue is not there in 9.4.1212-SNAPSHOT?
>
>
> as soon as you do we can release 1212

Works with 1212, thanks.

I tried it with

     https://oss.sonatype.org/content/repositories/snapshots/org/postgresql/postgresql/9.4.1212-SNAPSHOT/...

But that JAR file is missing the META-INF/services directory.

I don't know if that is due to it being a snapshot or if that is a general problem with the build system.

It should be added before a final release.

Thomas






-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
@ 2016-11-01 15:51         ` Jorge Solórzano <jorsol@gmail.com>
  2016-11-01 15:52           ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  1 sibling, 1 reply; 16+ messages in thread

From: Jorge Solórzano @ 2016-11-01 15:51 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

>
>
> Works with 1212, thanks.
>
> I tried it with
>
>     https://oss.sonatype.org/content/repositories/snapshots/org/
> postgresql/postgresql/9.4.1212-SNAPSHOT/postgresql-9.4.
> 1212-20161029.195806-15.jar
>
> But that JAR file is missing the META-INF/services directory.
>
> I don't know if that is due to it being a snapshot or if that is a general
> problem with the build system.
>


​​Fixed in PR: https://github.com/pgjdbc/pgjdbc/pull/676​



>
> It should be added before a final release.
>
>
> Thomas
>
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 15:51         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
@ 2016-11-01 15:52           ` Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Dave Cramer @ 2016-11-01 15:52 UTC (permalink / raw)
  To: Jorge Solórzano <jorsol@gmail.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

Thanks Jorge!

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 1 November 2016 at 11:51, Jorge Solórzano <jorsol@gmail.com> wrote:

>
>> Works with 1212, thanks.
>>
>> I tried it with
>>
>>     https://oss.sonatype.org/content/repositories/snapshots/org/
>> postgresql/postgresql/9.4.1212-SNAPSHOT/postgresql-9.4.1212-
>> 20161029.195806-15.jar
>>
>> But that JAR file is missing the META-INF/services directory.
>>
>> I don't know if that is due to it being a snapshot or if that is a
>> general problem with the build system.
>>
>
>
> ​​Fixed in PR: https://github.com/pgjdbc/pgjdbc/pull/676​
>
>
>
>>
>> It should be added before a final release.
>>
>>
>> Thomas
>>
>>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
@ 2016-11-01 22:47         ` Jorge Solórzano <jorsol@gmail.com>
  2016-11-02 07:56           ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 1 reply; 16+ messages in thread

From: Jorge Solórzano @ 2016-11-01 22:47 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

Thomas, can you please check the latest ​9.4.1212-SNAPSHOT? (
postgresql-9.4.1212-20161101.224154-17.jar
<https://oss.sonatype.org/content/repositories/snapshots/org/postgresql/postgresql/9.4.1212-SNAPSHOT/...;
)

​Thanks,​

Jorge Solórzano


On Tue, Nov 1, 2016 at 9:27 AM, Thomas Kellerer <spam_eater@gmx.net> wrote:

> Dave Cramer schrieb am 01.11.2016 um 15:03:
>
>>     I suggest we should cut 1212 as of now, and consider other PRs for
>> 1213
>>
>>     Thomas, can you please confirm that the issue is not there in
>> ​​
>> 9.4.1212-SNAPSHOT?
>>
>>
>> as soon as you do we can release 1212
>>
>
> Works with 1212, thanks.
>
> I tried it with
>
>     https://oss.sonatype.org/content/repositories/snapshots/org/
> postgresql/postgresql/9.4.1212-SNAPSHOT/postgresql-9.4.
> 1212-20161029.195806-15.jar
>
> But that JAR file is missing the META-INF/services directory.
>
> I don't know if that is due to it being a snapshot or if that is a general
> problem with the build system.
>
> It should be added before a final release.
>
>
> Thomas
>
>
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 22:47         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
@ 2016-11-02 07:56           ` Thomas Kellerer <spam_eater@gmx.net>
  2016-11-02 11:03             ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Thomas Kellerer @ 2016-11-02 07:56 UTC (permalink / raw)
  To: pgsql-jdbc

Jorge Solórzano schrieb am 01.11.2016 um 23:47:
>>     But that JAR file is missing the META-INF/services directory.
>>     I don't know if that is due to it being a snapshot or if that is a general problem with the build system.
> 
> Thomas, can you please check the latest 9.4.1212-SNAPSHOT? (postgresql-9.4.1212-20161101.224154-17.jar) 

Looks good. 

I don't need Class.forName() any more with that version.






-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 22:47         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
  2016-11-02 07:56           ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
@ 2016-11-02 11:03             ` Dave Cramer <pg@fastcrypt.com>
  2016-11-02 11:21               ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-02 15:18               ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Brad DeJong <Brad.Dejong@infor.com>
  0 siblings, 2 replies; 16+ messages in thread

From: Dave Cramer @ 2016-11-02 11:03 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

On 2 November 2016 at 03:56, Thomas Kellerer <spam_eater@gmx.net> wrote:

> Jorge Solórzano schrieb am 01.11.2016 um 23:47:
> >>     But that JAR file is missing the META-INF/services directory.
> >>     I don't know if that is due to it being a snapshot or if that is a
> general problem with the build system.
> >
> > Thomas, can you please check the latest 9.4.1212-SNAPSHOT?
> (postgresql-9.4.1212-20161101.224154-17.jar)
>
> Looks good.
>
> I don't need Class.forName() any more with that version.
>
>
>
> I don't believe that has been required for quite some time ?



Dave Cramer

davec@postgresintl.com
www.postgresintl.com

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 22:47         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
  2016-11-02 07:56           ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-02 11:03             ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
@ 2016-11-02 11:21               ` Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 0 replies; 16+ messages in thread

From: Thomas Kellerer @ 2016-11-02 11:21 UTC (permalink / raw)
  To: pgsql-jdbc

Dave Cramer schrieb am 02.11.2016 um 12:03:
>     Jorge Solórzano schrieb am 01.11.2016 um 23:47:
>     >>     But that JAR file is missing the META-INF/services directory.
>     >>     I don't know if that is due to it being a snapshot or if that is a general problem with the build system.
>     >
>     > Thomas, can you please check the latest 9.4.1212-SNAPSHOT? (postgresql-9.4.1212-20161101.224154-17.jar)
> 
>     Looks good.
> 
>     I don't need Class.forName() any more with that version.
> 
> 
> I don't believe that has been required for quite some time ?

The first snapshot I was testing (postgresql-9.4.1212-20161029.195806-15.jar) did not contain the necessary service information in the META-INF/services directory in the jar file. 

The new snapshot fixed this. 

Thomas



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2016-11-01 14:03     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 15:27       ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 22:47         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Jorge Solórzano <jorsol@gmail.com>
  2016-11-02 07:56           ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-02 11:03             ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
@ 2016-11-02 15:18               ` Brad DeJong <Brad.Dejong@infor.com>
  1 sibling, 0 replies; 16+ messages in thread

From: Brad DeJong @ 2016-11-02 15:18 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

On 2 November 2016 at 06:03, Dave Cramer wrote:
> On 2 November 2016 at 03:56, Thomas Kellerer <spam_eater@gmx.net<mailto:spam_eater@gmx.net>> wrote:
>> Jorge Solórzano schrieb am 01.11.2016 um 23:47:
>>>>     But that JAR file is missing the META-INF/services directory.
>>>>     I don't know if that is due to it being a snapshot or if that is a general problem with the build system.
>>>
>>> Thomas, can you please check the latest 9.4.1212-SNAPSHOT? (postgresql-9.4.1212-20161101.224154-17.jar)
>>
>> Looks good.
>>
>> I don't need Class.forName() any more with that version.
>
> I don't believe that has been required for quite some time ?

The implication is that he had to add a call to Class.forName() in order to test the snapshot jar where the META-INF/services directory was missing. Now that the META-INF/services/java.sql.Driver file is back, the service provider framework knows how to load the driver and so he does not need to call Class.forName() anymore.


^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@ 2017-03-02 08:54     ` Thomas Kellerer <spam_eater@gmx.net>
  2017-03-02 18:10       ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Mark Rotteveel <mark@lawinegevaar.nl>
  1 sibling, 1 reply; 16+ messages in thread

From: Thomas Kellerer @ 2017-03-02 08:54 UTC (permalink / raw)
  To: pgsql-jdbc

Vladimir Sitnikov schrieb am 01.11.2016 um 15:00:
>>This has been "broken" for a while now, you have to use ?? to get it to work.

This still doesn't work completely with a PreparedStatement. 

Other hstore operators that start with an ? do not work: ?& and ?|

e.g.:

   connection.prepareStatement("select * from foo where hstore_column ?& array['key']");
   connection.prepareStatement("select * from foo where hstore_column ?| array['key']");

The prepareStatement() call succeeds, but when calling executeQuery() an exception is thrown:

   org.postgresql.util.PSQLException: No value specified for parameter 1.

The goal is to pass the array as a parameter, something like: 

   Array keys = con.createArrayOf("text", new String[] {"key1","key2"});
   connection.prepareStatement("select * from foo where hstore_column ?& ?");
   pstmt.setArray(1, keys);
   ResultSet rs = pstmt.executeQuery();

Tested with 1212 and 42.0.0

Regards
Thomas
 



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2017-03-02 08:54     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
@ 2017-03-02 18:10       ` Mark Rotteveel <mark@lawinegevaar.nl>
  2017-03-02 19:04         ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2017-03-06 07:36         ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 2 replies; 16+ messages in thread

From: Mark Rotteveel @ 2017-03-02 18:10 UTC (permalink / raw)
  To: pgsql-jdbc

On 2017-03-02 09:54, Thomas Kellerer wrote:
> Vladimir Sitnikov schrieb am 01.11.2016 um 15:00:
>>> This has been "broken" for a while now, you have to use ?? to get it 
>>> to work.
> 
> This still doesn't work completely with a PreparedStatement.
> 
> Other hstore operators that start with an ? do not work: ?& and ?|
> 
> e.g.:
> 
>    connection.prepareStatement("select * from foo where hstore_column
> ?& array['key']");
>    connection.prepareStatement("select * from foo where hstore_column
> ?| array['key']");
> 
> The prepareStatement() call succeeds, but when calling executeQuery()
> an exception is thrown:
> 
>    org.postgresql.util.PSQLException: No value specified for parameter 
> 1.
> 
> The goal is to pass the array as a parameter, something like:
> 
>    Array keys = con.createArrayOf("text", new String[] 
> {"key1","key2"});
>    connection.prepareStatement("select * from foo where hstore_column 
> ?& ?");
>    pstmt.setArray(1, keys);
>    ResultSet rs = pstmt.executeQuery();
> 
> Tested with 1212 and 42.0.0

I haven't tried it, but would you logically need to use ??& and ??|, if 
the ? operator is escaped using ??

Mark


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2017-03-02 08:54     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2017-03-02 18:10       ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Mark Rotteveel <mark@lawinegevaar.nl>
@ 2017-03-02 19:04         ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  1 sibling, 0 replies; 16+ messages in thread

From: Vladimir Sitnikov @ 2017-03-02 19:04 UTC (permalink / raw)
  To: pgsql-jdbc@postgresql.org, Mark Rotteveel <mark@lawinegevaar.nl>

Mark>I haven't tried it, but would you logically need to use ??& and ??|, if
the ? operator is escaped using ??

That's right.
PreparedStatement requires ? to be represented as ?? (that is pgjdbc's
quirk).
Regular statement (non prepared) does not require ?? escaping.

pgjdbc does not parse statements hard enough to tell if the particular ? is
a bind variable or if it is a part of json operator.
Pull requests are welcome (provided parsing does not take too much CPU)

Vladimir


чт, 2 мар. 2017 г. в 21:10, Mark Rotteveel <mark@lawinegevaar.nl>:

> On 2017-03-02 09:54, Thomas Kellerer wrote:
> > Vladimir Sitnikov schrieb am 01.11.2016 um 15:00:
> >>> This has been "broken" for a while now, you have to use ?? to get it
> >>> to work.
> >
> > This still doesn't work completely with a PreparedStatement.
> >
> > Other hstore operators that start with an ? do not work: ?& and ?|
> >
> > e.g.:
> >
> >    connection.prepareStatement("select * from foo where hstore_column
> > ?& array['key']");
> >    connection.prepareStatement("select * from foo where hstore_column
> > ?| array['key']");
> >
> > The prepareStatement() call succeeds, but when calling executeQuery()
> > an exception is thrown:
> >
> >    org.postgresql.util.PSQLException: No value specified for parameter
> > 1.
> >
> > The goal is to pass the array as a parameter, something like:
> >
> >    Array keys = con.createArrayOf("text", new String[]
> > {"key1","key2"});
> >    connection.prepareStatement("select * from foo where hstore_column
> > ?& ?");
> >    pstmt.setArray(1, keys);
> >    ResultSet rs = pstmt.executeQuery();
> >
> > Tested with 1212 and 42.0.0
>
> I haven't tried it, but would you logically need to use ??& and ??|, if
> the ? operator is escaped using ??
>
> Mark
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: JDBC and the hstore ? operator - no longer working with build 1211
  2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2016-11-01 13:53 ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Dave Cramer <pg@fastcrypt.com>
  2016-11-01 14:00   ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2017-03-02 08:54     ` Re: JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
  2017-03-02 18:10       ` Re: Re: JDBC and the hstore ? operator - no longer working with build 1211 Mark Rotteveel <mark@lawinegevaar.nl>
@ 2017-03-06 07:36         ` Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 0 replies; 16+ messages in thread

From: Thomas Kellerer @ 2017-03-06 07:36 UTC (permalink / raw)
  To: pgsql-jdbc

Mark Rotteveel schrieb am 02.03.2017 um 19:10:
>>    connection.prepareStatement("select * from foo where hstore_column ?& array['key']");
>>    connection.prepareStatement("select * from foo where hstore_column ?| array['key']");
>>
>> The prepareStatement() call succeeds, but when calling executeQuery()
>> an exception is thrown:
>>
>>    org.postgresql.util.PSQLException: No value specified for parameter 1.
>>
>> The goal is to pass the array as a parameter, something like:
>>
>>    Array keys = con.createArrayOf("text", new String[] {"key1","key2"});
>>    connection.prepareStatement("select * from foo where hstore_column ?& ?");
>>    pstmt.setArray(1, keys);
>>    ResultSet rs = pstmt.executeQuery();
>>
>> Tested with 1212 and 42.0.0
> 
> I haven't tried it, but would you logically need to use ??& and ??|, if the ? operator is escaped using ??

That indeed does work. 

We first tried it with an obfuscation layer (aka "ORM") which seems to mess around with those operators and breaks that escaping.

Thomas





-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 16+ messages in thread


end of thread, other threads:[~2017-03-06 07:36 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-31 21:07 JDBC and the hstore ? operator - no longer working with build 1211 Thomas Kellerer <spam_eater@gmx.net>
2016-11-01 13:53 ` Dave Cramer <pg@fastcrypt.com>
2016-11-01 14:00   ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2016-11-01 14:03     ` Dave Cramer <pg@fastcrypt.com>
2016-11-01 15:27       ` Thomas Kellerer <spam_eater@gmx.net>
2016-11-01 15:51         ` Jorge Solórzano <jorsol@gmail.com>
2016-11-01 15:52           ` Dave Cramer <pg@fastcrypt.com>
2016-11-01 22:47         ` Jorge Solórzano <jorsol@gmail.com>
2016-11-02 07:56           ` Thomas Kellerer <spam_eater@gmx.net>
2016-11-02 11:03             ` Dave Cramer <pg@fastcrypt.com>
2016-11-02 11:21               ` Thomas Kellerer <spam_eater@gmx.net>
2016-11-02 15:18               ` Brad DeJong <Brad.Dejong@infor.com>
2017-03-02 08:54     ` Thomas Kellerer <spam_eater@gmx.net>
2017-03-02 18:10       ` Mark Rotteveel <mark@lawinegevaar.nl>
2017-03-02 19:04         ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2017-03-06 07:36         ` Thomas Kellerer <spam_eater@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox