Re: Group by clause problem with postgresql jdbc 9.0-801 - Mailing list pgsql-jdbc

From Maciek Sakrejda
Subject Re: Group by clause problem with postgresql jdbc 9.0-801
Date
Msg-id CAH_hXRZj2vUNZLnYbCtSdJn_V4sAZvU=fW912CjWOMji7AbdRg@mail.gmail.com
Whole thread Raw
In response to Re: Group by clause problem with postgresql jdbc 9.0-801  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: Group by clause problem with postgresql jdbc 9.0-801
List pgsql-jdbc
Could this be the difference between

cqdb=# prepare foo(int, int) as select x / $1 from generate_series(1,10) x group by x / $2; execute foo(3,3);
ERROR:  column "x.x" must appear in the GROUP BY clause or be used in an aggregate function
ERROR:  prepared statement "foo" does not exist

and

cqdb=# select x / 3 from generate_series(1,10) x group by x / 3;
 ?column?
----------
        2
        0
        3
        1
(4 rows)

?

This could be the case if Navicat is inlining the parameters. Unfortunately, I can't think of a good suggestion for a fix if this is indeed the case (except that the generated queries should group by the columns of interest, rather than repeating the expressions, but that's probably not an easy fix)...

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

pgsql-jdbc by date:

Previous
From: "Johann 'Myrkraverk' Oskarsson"
Date:
Subject: Re: Patch: Some more state codes
Next
From: Simon Riggs
Date:
Subject: Re: Group by clause problem with postgresql jdbc 9.0-801