r - I cannot connect postgresql schema.table with dplyr package -


im trying connect postgres dplyr functions

my_db <- src_postgres(dbname = 'mdb1252', user = "diego", password = "pass") my_db src:  postgres 9.2.5 [postgres@localhost:5432/mdb1252] tbls: alf, alturas, asociad, atenmed, base, bfa_boys_p_exp, bfa_boys_z_exp,   bfa_girls_p_exp, bfa_girls_z_exp, bres, c21200012012, c212000392011, c212000532011,   c21200062012, c212006222012, c212007352012, c212012112013, c212012242012,   c212012452012, c2222012242012, calles, cap, cap0110, casos_tbc_tr09, casos_tbctr09,   casosvadela, catpo, cbcvl, cie09, cie10, cie103d, cie103dantigua, cie10c, cie9a,   cie9mc, clasiarc, coalc, coddepto, codedades, codest, codlocaerbio, codprov, coheb,   cohec, cohep, cohiv, coho09_20110909_m, coign, combl, comet, comp, comport, conev,   conymad, copri, corci3cod, corci910, cores, corin, cotab, cutoi, cutto, def0307,...... 

but when try connect tbl

my_tbl <- tbl(my_db, 'def0307')  error in postgresqlexecstatement(conn, statement, ...) :    rs-dbi driver: (could not retrieve result : error:  no existe la relaciĆ³n «def0307» line 1: select * "def0307" 0=1;                       ^ ) 

i think problem schema issue because sql should be:

 select * mortalidad.def0307 

i made my_tbl <- tbl(my_db, 'mortalidad.def0307');

my_tbl <- tbl(my_db, c('mortalidad','def0307')) without solution.

im having lot of fun working dplyr im sql wish resolve , trying dplyr skills.

thanks in advance.

you might want this,

db=src_postgres(dbname = 'mdb1252',                  user = "diego", password = "pass", options="-c search_path=mortalidad") 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -