pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Arsalan Zaidi <azaidi@directi.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: query works in psql, but not thru JDBC
Date: Tue, 05 Jun 2001 10:16:40 -0400
Message-ID: <15229.991750600@sss.pgh.pa.us> (raw)
In-Reply-To: <006a01c0edad$9fd16800$4301a8c0@directi.com>
References: <006a01c0edad$9fd16800$4301a8c0@directi.com>

"Arsalan Zaidi" <azaidi@directi.com> 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



view thread (2+ messages)

Message-ID: <15229.991750600@sss.pgh.pa.us>
Permalink:  ../15229.991750600@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15229.991750600@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, azaidi@directi.com
  Subject: Re: query works in psql, but not thru JDBC
  In-Reply-To: <15229.991750600@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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