0

I decided to learn to use R to access Wharton Research Database Services (WRDS). I followed the WRDS instructions to connect from my Mac using Big Sur via R. It worked fine at first, however since then I have not been able to access any WRDS webpage via browser. The page won't load and my browser will tell me that the webpage took too long to respond. This happens on all devices connected to my Wifi network, but it works on other wifi connections or even via remote connections to another computer on university campus. Establishing a connection via R has since also failed and simply errors after a couple minutes due to a webpage timeout error.

I rebooted my router, and even reset to factory settings, but it didn't help. I have shut down the computer and R that established the connection at first, but no resolve either.

I don't think me playing around with PostgreSQL and this now happening is a coincidence, but I am fully out of ideas.

Here is the R Code I used to connect originally:

library(RPostgres)

wrds <- dbConnect(Postgres(),
  host='wrds-pgdata.wharton.upenn.edu', 
  port=9737, 
  dbname='wrds', 
  sslmode='require',
  user=myUserName)

res <- dbSendQuery(wrds, "select distinct table_schema
  from information_schema.tables
  where table_type = 'VIEW'
  or table_type = 'FOREIGN TABLE'
  order by table_schema")

data <- dbFetch(res, n=-1)
dbClearResult(res)

I would appreciate any ideas on what is happening here. Thank you in advance!

EDIT: Maybe I should have added, the process also had me create a .pgpass file via terminal in my /users/usr directory via terminal. The file is just one line of 'wrds-pgdata.wharton.upenn.edu:9737:wrds:username:password', where I filled in my username and password that I use to access WRDS.

1 Answers1

1

While I do not know anything about the specifics about how WRDS is provided (and with the added caveat that a lot could be going on in client/server communication) it should not. The PostgreSQL network traffic from psql or the RPostgreSQL package using the same underlying library use one port, and webtraffic uses another (generally 80 for http).

Now, there could be another layer where maybe they count connection attemts at they decide to block at the network layer. That is possible but I would call it unlikely. One way to test would be connect to WRDS from another network (if you can).

Testing such setups can be very frustrating. PostgreSQL alone can be frustrating at the begging until you have pg_hba.conf and alike correct. In this case I suggest to get back to their documentation and test via possible alternate routes. While I am familiar with RPostgreSQL (as the initial maintainer when it was written during a GSoC) I cannot help you as I have no WRDS credentials.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Another possibility, related to connection-counting: they could be throttling connections either due to a surge in activity (such as API quotas) or authentication problems (auth failures, such as `fail2ban`). I think Dirk's suggestion to test from another network is the first step I would try. – r2evans Dec 31 '20 at 19:48
  • Thanks for the feedback! I am able to connect to wrds from my university machine that is connected to the university network. Using my phone to access the wrds homepage does also fail when I use my wifi, but works fine if I use my LTE. Am I right in assuming that WRDS may be blocking my IP address or similar? – Paul Obermann Dec 31 '20 at 20:12
  • "Maybe". Hard to tell. But yes, your phone (on wifi) and your computer would come via the same IP address. Switching to LTE pretty much poinpoints to some network-level block of the IP as I had hinted in my answer. – Dirk Eddelbuettel Dec 31 '20 at 20:18