相关疑难解决方法(0)

在表上添加触发器时,PSQLException和锁定问题

更新:我从问题中消除了休眠。我完全重新编写了对问题的描述,以尽可能地简化它。

我有master带noop触发器的detail表和带masterdetail表之间的两个关系的表:

create table detail (
  id bigint not null,
  code varchar(255) not null,
  primary key (id)
);

create table master (
  id bigint not null,
  name varchar(255),
  detail_id bigint, -- "preferred" detail is one-to-one relation
  primary key (id),
  unique (detail_id),
  foreign key (detail_id) references detail(id)
);

create table detail_candidate ( -- "candidate" details = many-to-many relation modeled as join table
  master_id bigint not null,
  detail_id bigint not null,
  primary key (master_id, …
Run Code Online (Sandbox Code Playgroud)

postgresql triggers locking

12
推荐指数
1
解决办法
336
查看次数

标签 统计

locking ×1

postgresql ×1

triggers ×1