I am using RPostgres packages to send data query from WRDS server in RStudio with the codes:
library(RPostgres)
wrds <- dbConnect(Postgres(),
host='wrds-pgdata.wharton.upenn.edu',
port=9737,
dbname='wrds',
sslmode='require',
user='my_username')
res <- dbSendQuery(wrds, "SELECT * FROM taqmsec.ctm_20200102")
data <- dbFetch(res, n=-1)
However, when it comes to data fetch step using dbFetch function, it keeps running and return no results when n=-1 (which means fetching the full datasets). If n is positive, which means fetch the first n rows of the datasets, then it works. So what is going on here? Thx.