Run a query that would not return any rows, but which would anyway have defined columns, e.g.
con <- RPostgreSQL::dbConnect(DBI::dbDriver("PostgreSQL"), dbname = dbname,
host = host, port = 5432,
user = user, password = password)
RPostgreSQL::dbGetQuery(con, "select 'a' as col1, 'b' as col2 where false")
Expected results:
Should return a data.frame with zero rows and the column names that would be specified by the query.
Actual results:
Returns an empty data.frame with zero rows and zero columns.
Steps to reproduce:
Expected results: Should return a
data.frame
with zero rows and the column names that would be specified by the query.Actual results: Returns an empty
data.frame
with zero rows and zero columns.