Postgres client locking up when creating new table

前端 未结 2 1175
挽巷
挽巷 2021-02-05 17:56

I\'m trying to create a new table in postgres but when I do it just hangs after the CREATE TABLE call.

$ sudo usermod -s /bin/bash postgres
$ sudo s         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 18:30

    This is explained in this thread; http://www.postgresql.org/message-id/75218696-61be-4730-89f6-dd6058fa9eda@a28g2000prb.googlegroups.com

    According to Tom Lane,

    this create operation references auth_user table and PostgreSQL should add triggers to both tables. So if there is a long-running (probably idle) open transaction that's holding AccessShare lock on auth_user Postgres is blocked waiting for that xact to finish and release its lock. Everything else queues up behind the Create.

    That PostgreSQL Mail thread is a good read.

提交回复
热议问题