pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: query problem
5+ messages / 4 participants
[nested] [flat]

* Re: query problem
@ 2003-01-13 21:47  Nick Fankhauser <nickf@ontko.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Nick Fankhauser @ 2003-01-13 21:47 UTC (permalink / raw)
  To: helen liu <helengliu@yahoo.com>; pgsql-admin

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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: query problem
@ 2003-01-14 04:16  helen liu <helengliu@yahoo.com>
  parent: Nick Fankhauser <nickf@ontko.com>
  0 siblings, 1 reply; 5+ messages in thread

From: helen liu @ 2003-01-14 04:16 UTC (permalink / raw)
  To: nickf@ontko.com; pgsql-admin


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 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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: query problem
@ 2003-01-14 13:55  Nick Fankhauser <nickf@ontko.com>
  parent: helen liu <helengliu@yahoo.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Nick Fankhauser @ 2003-01-14 13:55 UTC (permalink / raw)
  To: helen liu <helengliu@yahoo.com>; pgsql-admin

Helen-

What I meant by "code sample" was the java code. Clearly there is nothing
wrong with the sql, but since you're probably returning more columns with
the first statement than the second one, my guess is that the java code
which processes the ResultSet works in the first case because it is
expecting more than 2 columns, but fails in the second when it attempts to
process the third and subsequent columns. Looking at the java code for
processing the result would tell us for sure.

-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:17 PM
To: nickf@ontko.com; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] query problem


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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Query problem
@ 2011-09-05 19:00  Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Lukasz Brodziak @ 2011-09-05 19:00 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have two DBs from the same user. When I run a query: SELECT
wer_sys||'.'||wer_int||'.'||wer_wew FROM ver WHERE code = '1243' on a boken
DB I get an error:  ERROR:  array value must start with "{" or dimension
information but when I try to run the query on a "healthy" DB I don't have
the error. Can anyone please guide me where to look for the problem. Already
tried restoring the table I run the query on from the non-broken DB but t
didn't work. While updating the database with our client program I get psql
error: out of memory. The pg version is 8.2 (yes it's old but we are
migrating to 9.0).
-- 
Ɓukasz Brodziak
"Do you bury me when I'm gone
Do you teach me while I'm here
Just as soon I belong
Then it's time I disappear"

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Query problem
@ 2011-09-07 18:04  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Kevin Grittner @ 2011-09-07 18:04 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; pgsql-admin

Lukasz Brodziak <lukasz.brodziak@gmail.com> wrote:
 
> I have two DBs from the same user. When I run a query: SELECT
> wer_sys||'.'||wer_int||'.'||wer_wew FROM ver WHERE code = '1243'
> on a boken DB I get an error:  ERROR:  array value must start with
> "{" or dimension information but when I try to run the query on a
> "healthy" DB I don't have the error. Can anyone please guide me
> where to look for the problem.
 
The column is defined as holding an array on one database and a
scalar value on the other?  Hard to tell without seeing the table
definitions.
 
> Already tried restoring the table I run the query on from the
> non-broken DB but t didn't work.
 
Meaning what?
 
> While updating the database with our client program I get psql
> error: out of memory.
 
How do you get a psql error if you're in a client program?  Exactly
what error do you get?  Is there anything in the logs?
 
> The pg version is 8.2
 
8.2.what?
 
You should probably review this page before your next post:
 
http://wiki.postgresql.org/wiki/Guide_to_reporting_problems
 
-Kevin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2011-09-07 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13 21:47 Re: query problem Nick Fankhauser <nickf@ontko.com>
2003-01-14 04:16 ` helen liu <helengliu@yahoo.com>
2003-01-14 13:55   ` Nick Fankhauser <nickf@ontko.com>
2011-09-05 19:00 Query problem Lukasz Brodziak <lukasz.brodziak@gmail.com>
2011-09-07 18:04 ` Re: Query problem Kevin Grittner <Kevin.Grittner@wicourts.gov>

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