Postgresql 博士后寻找与错误姓名的关系

Postgresql 博士后寻找与错误姓名的关系,postgresql,hibernate,Postgresql,Hibernate,在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

在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);
该序列(由冲压历史序列字段自动生成):

插入(持久化)到冲压表工作,但有时,显然没有理由,它会失败,并出现以下错误:

"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"
为什么博士后要寻找“打孔”与“打孔”的关系?它一直在按历史顺序打孔


谢谢

您可能需要将生成值的策略更改为
GenerationType.SEQUENCE
-查看一下(但也要注意)。尝试将
ID\u PUNCHING
设置为小写
@列(name=“ID\u PUNCHING”,unique=true,nullable=false)
。我也有同样的问题,这有助于me@IgorCova你的解决方案似乎有点奇怪,但我会尝试一下:它对你有帮助吗?现在说,我必须尝试足够长的时间还为时过早
"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"
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_PUNCHING", unique = true, nullable = false)
private Integer idPunching;