Re: Columns out of range-error

Lists: pgsql-jdbc
From: "Tobias Zielke" <tobias(dot)zielke(at)automedia(dot)de>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Columns out of range-error
Date: 2004-08-20 14:20:34
Message-ID: 200408201417.i7KEHPwL099964@stefan7.han-solo.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

We have a Problem with postgresql 7.4.3 and jdbc

We have a table with 200 columns and want to insert 50 datasets (40-50
columns each) into this table. With this we write a file into the memory
with about 650 columns. And this displays an error: columnindex out of
range.
In the #postgres IRC i was told to ask you if this could be a bug in jdbc.

Thnx
Woolve73
Toby


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: tobias(dot)zielke(at)automedia(dot)de
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Columns out of range-error
Date: 2004-08-20 14:32:28
Message-ID: 1093012348.20381.4.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Toby,

You will have to give us more information.

can you show us the relevant code ?

But in general you can't put 650 columns into 200 columns ?

How is that supposed to work ?

Dave
On Fri, 2004-08-20 at 10:20, Tobias Zielke wrote:
> Hi,
>
> We have a Problem with postgresql 7.4.3 and jdbc
>
> We have a table with 200 columns and want to insert 50 datasets (40-50
> columns each) into this table. With this we write a file into the memory
> with about 650 columns. And this displays an error: columnindex out of
> range.
> In the #postgres IRC i was told to ask you if this could be a bug in jdbc.
>
> Thnx
> Woolve73
> Toby
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Dave Cramer
519 939 0336
ICQ # 14675561
www.postgresintl.com


From: "Andreas Percher" <andreas(dot)percher(at)automedia(dot)de>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Columns out of range-error
Date: 2004-08-20 15:06:17
Message-ID: 000101c486c7$410b4cd0$1600a8c0@developer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I'm a Newbe in using commitment control.
Toby (Woolve73) is my Colleague.
So I try to refine his question.

Step 1
We've got a Table with 203 columns.
We wan't to add (insert) up to 150 new rows.
Each row need 38-52 columns.

Step 2
Using pgAdmin anithing is fine.
Adding "begin" and "roolback" (we don't want to kill our live database)
- it works. Sending the inserts out of our Java-Application without
start/roolback works too.

Step 3
Now back in Java.
Sending a "begin" it gives us a SQL Error
"Spaltenindex außerhalb des gültigen Bereichs"
Which meens
"The column index is out of range."

--> postgresql.res.colrange:Spaltenindex außerhalb des gültigen Bereichs

--> postgresql.res.colrange:The column index is out of range.

This error message occur after 13-16 inserts, depending on the column
count of each insert. Sending the inserts without the long data field
"specialequipment", results in letting the error occur one insert later.

In case of the Error, round about 600 columns (counted over all inserts)
are waiting for its commitment.

Step 4
We are confused.
We need to use commitment control, because if one insert, update or
delete fails, or if an error in the data input stream occurs, we have to
rollback.

> Toby,
>
> You will have to give us more information.
> can you show us the relevant code ?
> But in general you can't put 650 columns into 200 columns ? How is
> that supposed to work ?
>
> Dave
> On Fri, 2004-08-20 at 10:20, Tobias Zielke wrote:
> > Hi,
> >
> > We have a Problem with postgresql 7.4.3 and jdbc
> > ...
> > Thnx
> > Woolve73
> > Toby


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: andreas(dot)percher(at)automedia(dot)de
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Columns out of range-error
Date: 2004-08-21 02:18:22
Message-ID: 4126B0EE.2070900@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Andreas Percher wrote:

> Sending a "begin" it gives us a SQL Error
> "Spaltenindex außerhalb des gültigen Bereichs"
> Which meens
> "The column index is out of range."
>
> --> postgresql.res.colrange:Spaltenindex außerhalb des gültigen Bereichs
>
> --> postgresql.res.colrange:The column index is out of range.
>
> This error message occur after 13-16 inserts, depending on the column
> count of each insert. Sending the inserts without the long data field
> "specialequipment", results in letting the error occur one insert later.
>
> In case of the Error, round about 600 columns (counted over all inserts)
> are waiting for its commitment.

Can you provide the full stack trace? I just dug through the driver and
the only place that this exception will be thrown is when querying a
ResultSet (either a ResultSet.getXXX() call, or from inspecting a
ResultSetMetaData). It seems strange that these methods would ever get
invoked if you're only doing updates..

-O


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: andreas(dot)percher(at)automedia(dot)de, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Columns out of range-error
Date: 2004-08-21 16:03:07
Message-ID: 1093104187.20387.84.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Oliver,

This should throw an error if you try to setXXX(n,obj) if n is greater
than the number of parameters you have?

dave
On Fri, 2004-08-20 at 22:18, Oliver Jowett wrote:
> Andreas Percher wrote:
>
> > Sending a "begin" it gives us a SQL Error
> > "Spaltenindex außerhalb des gültigen Bereichs"
> > Which meens
> > "The column index is out of range."
> >
> > --> postgresql.res.colrange:Spaltenindex außerhalb des gültigen Bereichs
> >
> > --> postgresql.res.colrange:The column index is out of range.
> >
> > This error message occur after 13-16 inserts, depending on the column
> > count of each insert. Sending the inserts without the long data field
> > "specialequipment", results in letting the error occur one insert later.
> >
> > In case of the Error, round about 600 columns (counted over all inserts)
> > are waiting for its commitment.
>
> Can you provide the full stack trace? I just dug through the driver and
> the only place that this exception will be thrown is when querying a
> ResultSet (either a ResultSet.getXXX() call, or from inspecting a
> ResultSetMetaData). It seems strange that these methods would ever get
> invoked if you're only doing updates..
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
--
Dave Cramer
519 939 0336
ICQ # 14675561
www.postgresintl.com


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: pg(at)fastcrypt(dot)com
Cc: andreas(dot)percher(at)automedia(dot)de, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Columns out of range-error
Date: 2004-08-22 00:33:28
Message-ID: 4127E9D8.3090100@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Dave Cramer wrote:
> Oliver,
>
> This should throw an error if you try to setXXX(n,obj) if n is greater
> than the number of parameters you have?

On a PreparedStatement? That throws postgresql.prep.range not
postgresql.res.colrange.

The ResultSet.updateXXX() methods would be the other place I would
expect an exception to be thrown from, but I looked at them just now and
they seem to do no range checking at all -- you'll just get an
ArrayIndexOutOfBoundsException!

-O