Skip to content

Creating indexes on startup of couch2pg causes locks in postgres #193

@witash

Description

@witash

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

Metadata

Metadata

Assignees

Labels

Type: BugFix something that isn't working as intendedreleased

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions