Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. library(RPostgres)
  2. library(DBI)
  3. library(dplyr)
  4. library(sqldf)
  5.  
  6. pw<- {
  7. "password"
  8. }
  9.  
  10. conn <- dbConnect(RPostgres::Postgres()
  11. , host="host-name"
  12. , port='5432'
  13. , dbname="database-name"
  14. , user="username"
  15. , password=pw)
  16.  
  17. dbExistsTable(conn, "Test_Table")
  18. #TRUE
  19. dbListTables(conn)
  20.  
  21. mydf <- dbReadTable(conn, "Test_Table") # To Read the table in R
  22.  
  23. SELECT table_name FROM INFORMATION_SCHEMA.tables WHERE table_schema = ANY (current_schemas(false));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement