ctti-clinicaltrials / aact

Improving Public Access to Aggregate Content of ClinicalTrials.gov
http://aact.ctti-clinicaltrials.org
MIT License
126 stars 34 forks source link

pg_restore issue - ctti role does not exist #774

Closed zsalzbank closed 4 years ago

zsalzbank commented 4 years ago

Since 4.4.0 has been pushed, I'm having trouble loading the data. Usually, I can run the following without any problems:

psql -a -c ""DROP SCHEMA IF EXISTS ctgov CASCADE""
pg_restore -e -v -x -O -d mydb dumpfile

But now, I'm getting errors when I do that:

pg_restore: [archiver (db)] could not execute query: FATAL:  role "ctti" does not exist
SSL connection has been closed unexpectedly
     Command was: ALTER ROLE ctti IN DATABASE aact SET search_path TO 'ctgov', 'support', 'public';

It seems that the command mentioned in the error was not previously in the daily (or monthly) dump files. Was it added on purpose? I do not have a ctti user (and cannot create one).

zsalzbank commented 4 years ago

I was able to workaround this by manually creating the ctgov schema and adding -n ctgov to my pg_restore command. I'll close this.

tibbs001 commented 4 years ago

Before seeing your follow-up comment, I tried it out using the suggested syntax on the AACT website: https://aact.ctti-clinicaltrials.org/snapshots

pg_restore -e -v -O -x -d aact --no-owner postgres_data.dmp

This worked with no ctti user in my postgres db, but good to know the -n ctgov option also works. Thanks.

zsalzbank commented 4 years ago

Interesting. Not sure what the difference would be there since -O and --no-owner should be the same.

Thanks anyways.