apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Rossi <bob_ro...@cox.net>
Subject sqlite3 and postgresql
Date Sat, 17 May 2008 13:07:54 GMT
Hi,

I've been using sqlite3 dbd for some time now. I find that the function
apr_dbd_get_row,
  http://apr.apache.org/docs/apr-util/trunk/group___a_p_r___util___d_b_d.html#gd4cdc5f4e8981b93f5a467a8c8a768f1
is 1 based. That is, 1 is the first row returned from a query. However,
I just started using postgresql, and I find that apr_dbd_get_row is 0
based. That is, 0 is the first row returned from the query.

Is this expected behavior? Perhaps a bug in my test? The test is,
 "create table tbl1(one varchar(10), two smallint);"
 "insert into tbl1 values('hello!',10);"
 "insert into tbl1 values('goodbye', 20);
 "select * from tbl1;"

and then I call apr_dbd_get_row, and compare that the first row returned
from the query matches the "hello!" and the second matches the
"goodbye". With sqlite3 driver, I have to pass in 1 and 2 to
apr_dbd_get_row. With postgresql driver, I have to pass in 0 and 1.

Is this something I should code up on my side?

Thanks,
Bob Rossi

Mime
View raw message