Skip to content
Prev 6684 / 15075 Next

ODBC driver with postgresql

Tim,

Coming to this with a bit of a delay, but one of the things that you  
may wish to try is to set 'rows_at_time = 1' in your calls to  
sqlQuery(). See the help file for the function.

Prior to RODBC version 1.3-0, this defaulted to 1. However, beginning  
with 1.3-0, the default changed to 100.

I had problems with the new default value using RODBC connecting to an  
Oracle server. These were typically queries returning 0 rows, where I  
knew that there should be more than that and typically in the  
hundreds. The problem manifested itself when the view names were > 11  
or 12 characters. This had suggested the possibility of a pointer gone  
awry, stepping on and corrupting the query result. However, I could  
never confirm that and Prof. Ripley could not replicate the problem on  
his end.

I think that lacking further investigation, it may be representative  
of a bug in the ODBC driver itself.

Setting 'rows_at_time' to 1 has resolved the problem for me and you  
should see if that resolves anything in your situation.

BTW, the error message that you get below after loading RODBC on Linux  
suggests that you need to re-install it. It appears to have been built  
using a prior version of R, before dynamically generated help files  
were introduced in recent versions.

HTH,

Marc Schwartz
On Dec 15, 2009, at 2:36 PM, Tim Coote wrote: