Alter Table For Postgres Replica Identity


We are using Hibernate hbm2ddl property for creating table.
In case of Postgres, we need to alter table to set replica identity to full for those tables which don’t have primary key.
Could you please confirm how can we achieve the same using hibernate?

You can use a SQL script by defining the following property:

      <property name="javax.persistence.sql-load-script-source" value="META-INF/data.sql"/>

In that file, you just add your alter table statements.

1 Like