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

I've been using sqlite3 dbd for some time now. I find that the function
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?

Bob Rossi

View raw message