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

query works in psql, but not thru JDBC

From: "Arsalan Zaidi" <azaidi(at)directi(dot)com>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: query works in psql, but not thru JDBC
Date: 2001-06-05 10:52:27
Message-ID: 006a01c0edad$9fd16800$4301a8c0@directi.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi.

I'm running this query, which is constructed from parameters passed to a
function.

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

SQL State : NULL
Error Code : 0
------------------------

Why does it work from the command line and not through JDBC?

Thanks in advance.

--Arsalan.


Responses

pgsql-interfaces by date

Next:From: Tom LaneDate: 2001-06-05 13:56:15
Subject: Re: What is the difference between the two MSI insta llers?
Previous:From: Dave PageDate: 2001-06-05 07:43:14
Subject: RE: What is the difference between the two MSI installers?

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