[R-sig-DB] R and Postgres

Sean Davis @d@v|@2 @end|ng |rom m@||@n|h@gov
Wed Jul 2 00:09:44 CEST 2008


On Tue, Jul 1, 2008 at 5:25 PM, Bryce Baril <bryce using marketoutsider.com> wrote:
> Excellent, thank you to everyone who helped!
>
> This is what I did to install the packages:
>
> install.packages(c('Rdbi','RdbiPgSQL'), repos="
> http://bioconductor.org/packages/1.9/bioc/", dependencies=TRUE)

This version is a year+ old.  Your best bet is to do:

source('http://bioconductor.org/biocLite.R')
biocLite('RdbiPgSQL')

This will get you a version that matches your version of R.

Sean


> And then I followed Steve Henshaw's generic example:
>
> On Tue, Jul 1, 2008 at 1:29 PM, Steve Henshaw <steve.henshaw using gmail.com>
> wrote:
>
>> Hi
>>
>> I run postgre 8.3 on linux and can access it, ive put a generic example of
>> how I got it to work below, ive only used it for a database on a local
>> machine.
>>
>> Hope it gives you a start :)
>>
>> #########
>>
>> library(Rdbi)
>> library(RdbiPgSQL)
>>
>> #establish connection
>> conn <- dbConnect(PgSQL(),host='host',dbname='mydatabasename',user='me')
>>
>> #send query
>> query <- dbSendQuery(conn,"select * from my table")
>>
>> #get results
>> results <- dbGetResult(query)
>>
>> #close connection
>> dbDisconnect(conn)
>>
>> ################
>>
>
> --
> Bryce B. Baril
> MarketOutsider.com
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
>




More information about the R-sig-DB mailing list