couch2pg attempts to create the couchdb table and indexes on saved_timestamp and deleted, using IF NOT EXISTS clauses to do nothing if the table and indexes are already created.
For create table if not exists this is fine, however for create index if not exists, postgres acquires a table lock BEFORE checking if the index already exists.
When dbt is running a long query against couch2pg, this means that the couch2pg script hangs.
couch2pg should only attempt to create indexes if the table did not exist