Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E1B60475F84 for ; Mon, 13 Jan 2003 23:17:40 -0500 (EST) Received: from web14611.mail.yahoo.com (web14611.mail.yahoo.com [216.136.173.218]) by postgresql.org (Postfix) with SMTP id CA78B4771CD for ; Mon, 13 Jan 2003 23:16:39 -0500 (EST) Message-ID: <20030114041644.55711.qmail@web14611.mail.yahoo.com> Received: from [64.161.213.210] by web14611.mail.yahoo.com via HTTP; Mon, 13 Jan 2003 20:16:44 PST Date: Mon, 13 Jan 2003 20:16:44 -0800 (PST) From: helen liu Subject: Re: query problem To: nickf@ontko.com, pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-680360625-1042517804=:54913" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/140 X-Sequence-Number: 6982 --0-680360625-1042517804=:54913 Content-Type: text/plain; charset=us-ascii Nick, Thank you very much for your response. Actually, here is the details:- I have a Students table with only three columns: firstname, lastname, email. I issued the following select statements: 1) select * from students; 2). select firstname, last name from students; query 1) worked fine, but query 2) got the following message in client side: "connect and execute query: The column index is out of range." and at db server side, I got error message: "LOG: pq_recvbuf: recv() failed: Connection reset by peer" I feel that JDBC doesn't like query 2). because both query 1) & 2) works if queried in db directly. Many thanks for any clarification on this. Helen Nick Fankhauser wrote:Helen- There is a separate JDBC list for related questions that I suggest you use in the future. A code sample is needed for a really good answer, but I'll make a guess. This message is probably telling you that you are either trying to set a value in a where clause that has a higher index than the number you prepared. (eg: you have two columns constrained and tried to set a third.) Or, you are trying to read a column from the resultset that has a higher index than those you defined when preparing the statement. (eg: your query returns two fields and you're asking for a third.) Your SQL statement may look fine, but you're either setting or getting something that it doesn't have. -Nick -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of helen liu Sent: Monday, January 13, 2003 11:44 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] query probelm Hello, I am new in postgresql. sorry if I may ask simple question. I got error message when I pass sql statement into database through JDBC. the error msg is: "connect and execute query: The column index is out of range." I check the sql statement string passed into db, it looks fine. I have no idea what is going wrong. any help is highly appreciated. Helen Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-680360625-1042517804=:54913 Content-Type: text/html; charset=us-ascii

Nick,

Thank you very much for your response. Actually, here is the details:-
I have a Students table with only three columns: firstname, lastname, email. I issued the following select statements:
1) select * from students; 
2). select firstname, last name from students;

query 1) worked fine, but query 2) got the following message in client side:
"connect and execute query: The column index is out of range."
and at db server side, I got error message:
"LOG:  pq_recvbuf: recv() failed: Connection reset by peer"

I feel that JDBC doesn't like query 2). because both query 1) & 2) works if queried in db directly.
Many thanks for any clarification on this.

Helen

 Nick Fankhauser <nickf@ontko.com> wrote:

Helen-

There is a separate JDBC list for related questions that I suggest you use
in the future.

A code sample is needed for a really good answer, but I'll make a guess.
This message is probably telling you that you are either trying to set a
value in a where clause that has a higher index than the number you
prepared. (eg: you have two columns constrained and tried to set a third.)
Or, you are trying to read a column from the resultset that has a higher
index than those you defined when preparing the statement. (eg: your query
returns two fields and you're asking for a third.)

Your SQL statement may look fine, but you're either setting or getting
something that it doesn't have.

-Nick




-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of helen liuSent: Monday, January 13, 2003 11:44 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] query probelm


Hello,
I am new in postgresql. sorry if I may ask simple question. I got error
message when I pass sql statement into database through JDBC. the error msg
is:
"connect and execute query: The column index is out of range."
I check the sql statement string passed into db, it looks fine. I have no
idea what is going wrong. any help is highly appreciated.
Helen




Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-680360625-1042517804=:54913--