Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f55EGxE24672 for ; Tue, 5 Jun 2001 10:16:59 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f55EGfR15232; Tue, 5 Jun 2001 10:16:41 -0400 (EDT) To: "Arsalan Zaidi" cc: pgsql-interfaces@postgresql.org Subject: Re: query works in psql, but not thru JDBC In-reply-to: <006a01c0edad$9fd16800$4301a8c0@directi.com> References: <006a01c0edad$9fd16800$4301a8c0@directi.com> Comments: In-reply-to "Arsalan Zaidi" message dated "Tue, 05 Jun 2001 16:22:27 +0530" Date: Tue, 05 Jun 2001 10:16:40 -0400 Message-ID: <15229.991750600@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200106/18 X-Sequence-Number: 1680 "Arsalan Zaidi" writes: > SELECT * FROM users WHERE userid = 4 ORDER BY name LIMIT 20 OFFSET 0 > When I run it from the command line inpsql, It works just fine, but when I > run it using the Postgresql JDBC driver (executeQuery()), I get this error > Err Mesg : ERROR: Attribute users.name must be GROUPed or used in an > aggregate function Curious. Does JDBC alter the query at all before it sends it? Try turning on query logging at the postmaster, and look in the postmaster log to see what is actually being sent. regards, tom lane