在 Postgresgl 中创建外键会出现以下错误:ERROR: AccessExclusiveLock required to add toast table

问题描述

我现在正在尝试解决有关创建外键的问题几个小时。 我在 Postgres 中有一个数据库添加一个新表。接下来我想从每个表创建一个外键到这个新表。对于大多数表,这没有问题。但是有些表格会出现这个问题:

def index
  settings = {
    id: nil # I think this would be needed
  }
  Setting.all.each do |setting|
    settings[setting.name] = setting.value
  end
  @settings = OpenStruct.new(settings)
end

我尝试在事务中锁定表,但消息相同。有没有人知道这可能导致什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)