I have following problem in R.
I connected to database using RPostgres package function dbConnect:
dbConnect(m, dbname=dbname, host=host, port=port, user=example, password=password)
The name of user is 'example' The name of one of the tables in database is also 'example'.
While running: dbGetQuery(db, "SELECT * from example") instead of getting the table, I get data frame 1x1 with only one value : example (the same as user value in dbConnect function)
It seems like the command dbGetQuery(db, "SELECT * from example") returns value of user from dbConnect(m, dbname=dbname, host=host, port=port, user=example, password=password) instead of returning table from database.
Do you have any ideas how to solve this problem?
conn <- dbConnect(m, dbname=dbname, host=host, port=port, user=example, password=password)and thendbGetQuery(conn, "SELECT * from example"). - 9314197select * from schema.example? - 9314197exampleor does it happen with all tables? - 9314197select * from schema.examplethat you wrote works, thank you :) - Agnieszka