[R-sig-DB] R and Postgres

Bryce Baril bryce @end|ng |rom m@rketout@|der@com
Tue Jul 1 23:25:18 CEST 2008


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)

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]]




More information about the R-sig-DB mailing list