Thread: Handling of Arrays broken..?

Handling of Arrays broken..?

From
Barend Köbben
Date:
Hi,

Since upgrading to PostgreSQL 9.1.2 and its psql-odbc driver (9.0.3.10),
the results of queries to arrays seems broken. I have an SQL 'items'
column of type character(3)[]. A 'normal' SQL query 'SELECT items FROM
table' results in a proper Array (shows in PgAdmin as {100,999,122} ).

In ASP JavaScript the same query done in an ADODB connection...

SQLcmd.CommandText = "SELECT items FROM table";
var RecSet = SQLcmd.Execute;

while (!RecSet.EOF && !RecSet.BOF) {
        var theItemsStr = RecSet.Fields.Item("items").Value;

...results in theItemsStr being '{10'

The same code worked in an earlier installation with Postgres 8.4 and its
driver (version?).


By accident I found that the same thing with the SQL "SELECT items[1:99]
FROM table" does work correctly (even if the array only has 3 items). Is
this a bug that has been introduced in the new version of the driver, or
is there something else I missed...?

Yours,

--
Barend Köbben
ITC - University of Twente,
Faculty of Geo-Information Science and Earth Observation
PO Box 217, 7500AE Enschede (The Netherlands)
+31-(0)53 4874 253






Faculty of Geo-Information Science and Earth Observation (ITC)
University of Twente
Chamber of Commerce: 501305360000

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the
intendedrecipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the
contentof this information is strictly prohibited. If you have received this e-mail by mistake, please delete the
messageand any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in
themessage content or for damage of any kind that may arise as a result of e-mail transmission. 

Re: Handling of Arrays broken..?

From
Hiroshi Inoue
Date:
Hi Barend,

(2012/03/27 17:30), Barend Köbben wrote:
> Hi,
>
> Since upgrading to PostgreSQL 9.1.2 and its psql-odbc driver (9.0.3.10),
> the results of queries to arrays seems broken. I have an SQL 'items'
> column of type character(3)[]. A 'normal' SQL query 'SELECT items FROM
> table' results in a proper Array (shows in PgAdmin as {100,999,122} ).
>
> In ASP JavaScript the same query done in an ADODB connection...
>
> SQLcmd.CommandText = "SELECT items FROM table";
> var RecSet = SQLcmd.Execute;
>
> while (!RecSet.EOF&&  !RecSet.BOF) {
>          var theItemsStr = RecSet.Fields.Item("items").Value;
>
> ...results in theItemsStr being '{10'
>
> The same code worked in an earlier installation with Postgres 8.4 and its
> driver (version?).
>
>
> By accident I found that the same thing with the SQL "SELECT items[1:99]
> FROM table" does work correctly (even if the array only has 3 items). Is
> this a bug that has been introduced in the new version of the driver, or
> is there something else I missed...?

Could you please try the drivers on testing for 9.1.0101 at
   http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/
?

regards,
Inoue, Hiroshi


Re: Handling of Arrays broken..?

From
Barend Köbben
Date:
Hi mr Hiroshi,

Assuming that I correctly did the install:
- unzipped the 3 .dll files in the ZIP on that URL
- replaced the ones with the same name in C:\Program
Files\PostgreSQL\psqlODBC\0900\bin
- restarted PG

I am sorry to say that it did not help. From the SQL
"SELECT items FROM table"

I still get back the String
'{10'

And from the SQL
"SELECT items[1:99] FROM table"

the String
'{101,112,999}'


Yours,
Barend


On 30-03-12 14:55, "Hiroshi Inoue" <inoue@tpf.co.jp> wrote:

>Hi Barend,
>
>(2012/03/27 17:30), Barend Köbben wrote:
>> Hi,
>>
>> Since upgrading to PostgreSQL 9.1.2 and its psql-odbc driver (9.0.3.10),
>> the results of queries to arrays seems broken. I have an SQL 'items'
>> column of type character(3)[]. A 'normal' SQL query 'SELECT items FROM
>> table' results in a proper Array (shows in PgAdmin as {100,999,122} ).
>>
>> In ASP JavaScript the same query done in an ADODB connection...
>>
>> SQLcmd.CommandText = "SELECT items FROM table";
>> var RecSet = SQLcmd.Execute;
>>
>> while (!RecSet.EOF&&  !RecSet.BOF) {
>>          var theItemsStr = RecSet.Fields.Item("items").Value;
>>
>> ...results in theItemsStr being '{10'
>>
>> The same code worked in an earlier installation with Postgres 8.4 and
>>its
>> driver (version?).
>>
>>
>> By accident I found that the same thing with the SQL "SELECT items[1:99]
>> FROM table" does work correctly (even if the array only has 3 items). Is
>> this a bug that has been introduced in the new version of the driver, or
>> is there something else I missed...?
>
>Could you please try the drivers on testing for 9.1.0101 at
>   http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/
>?
>
>regards,
>Inoue, Hiroshi
>
>
>--
>Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-odbc


Faculty of Geo-Information Science and Earth Observation (ITC)
University of Twente
Chamber of Commerce: 501305360000

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the
intendedrecipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the
contentof this information is strictly prohibited. If you have received this e-mail by mistake, please delete the
messageand any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in
themessage content or for damage of any kind that may arise as a result of e-mail transmission. 

Re: Handling of Arrays broken..?

From
Hiroshi Inoue
Date:
Hi Barend,

(2012/03/30 22:17), Barend Köbben wrote:
> Hi mr Hiroshi,
>
> Assuming that I correctly did the install:
> - unzipped the 3 .dll files in the ZIP on that URL
> - replaced the ones with the same name in C:\Program
> Files\PostgreSQL\psqlODBC\0900\bin
> - restarted PG
>
> I am sorry to say that it did not help. From the SQL
> "SELECT items FROM table"
>
> I still get back the String
> '{10'
>
> And from the SQL
> "SELECT items[1:99] FROM table"
>
> the String
> '{101,112,999}'

Could you send me directly the Mylog output?

regards,
Hiroshi Inoue

Re: Handling of Arrays broken..?

From
Barend Köbben
Date:
Hi Hiroshi,

Thanks for trying to help! I will send you the log file on Monday (can
only access the server's file system from my office). Where would I find
this "MyLog" output...?

Yours
Barend

On 31-03-12 11:15, "Hiroshi Inoue" <inoue@tpf.co.jp> wrote:

>Hi Barend,
>
>(2012/03/30 22:17), Barend Köbben wrote:
>> Hi mr Hiroshi,
>>
>> Assuming that I correctly did the install:
>> - unzipped the 3 .dll files in the ZIP on that URL
>> - replaced the ones with the same name in C:\Program
>> Files\PostgreSQL\psqlODBC\0900\bin
>> - restarted PG
>>
>> I am sorry to say that it did not help. From the SQL
>> "SELECT items FROM table"
>>
>> I still get back the String
>> '{10'
>>
>> And from the SQL
>> "SELECT items[1:99] FROM table"
>>
>> the String
>> '{101,112,999}'
>
>Could you send me directly the Mylog output?
>
>regards,
>Hiroshi Inoue


Faculty of Geo-Information Science and Earth Observation (ITC)
University of Twente
Chamber of Commerce: 501305360000

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the
intendedrecipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the
contentof this information is strictly prohibited. If you have received this e-mail by mistake, please delete the
messageand any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in
themessage content or for damage of any kind that may arise as a result of e-mail transmission.