postgresql - Postgres 查找名称错误的关系
问题描述
在 Postgres 中,我有以下表格:
CREATE TABLE punching_history (
id_punching serial NOT NULL,
punching_date timestamp without time zone,
-- other fields
CONSTRAINT punching_pk PRIMARY KEY (id_punching)
);
CREATE TABLE punching()
INHERITS (punching_history);
和这个序列(由 punching_history 的序列字段自动生成):
CREATE SEQUENCE punching_history_id_punching_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
插入(持久)到冲压表中有效,但有时,显然没有理由,它会失败并出现以下错误:
"HTTP 500 Internal Server Error - could not extract ResultSet
org.postgresql.util.PSQLException: ERROR: relation
<schema_name>.punching_id_punching_seq does not exist Position: 16"
在 Hibernate 中,主键映射为:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_PUNCHING", unique = true, nullable = false)
private Integer idPunching;
为什么 Postgres 寻找 punching_id_punching_seq 关系?它一直是punching_history_id_punching_seq。
谢谢
解决方案
推荐阅读
- java - 两个并行线程的静态块执行可以异步发生吗
- java - 如何使用 Rest Assured 在响应 API 中获取两个具有相同名称的不同字段?
- memory - gearman 内存不足,工作速度很慢
- python - Flask Restul 基本身份验证
- python - 如果它存在于另一个数据框中,则修改数据框中的行
- tensorflow - 无法启用 TensorFlow 急切执行
- kotlin - Kotlin 是否像 Python 一样有关键字“None”?
- ios - 推送导航控制器时出现异常 - iOS
- kotlin - Kotlin 中的 `?.apply`、`?.run` 和 `?.let` 之间的空值检查质量有什么区别吗?
- amazon-web-services - 使用带 boto3 的 ExternalQuestion 在 Amazon Mechnical Turk 上创建命中