That's very weird, the columns aren't named "originalId.REV", but just "REV", the former is just an in-envers name. Which version of Envers, Hibernate, PostgreSQL are you using? Also, do you have any specific Hibernate and Envers configuration?
Hibernate 3.3.1, Envers 1.2.2, Postgres 8.3.x.
Enironment: Seam-driven application on pure Tomcat 6.x, no JPA - hibernate only, Hibernate local transactions (Spring driven), wired by Seam component. No other problems with this configuration, using annotations-driven configuration (@Enity) without any problems except this one with envers.
Configuration of Envers made in hibernate.cfg using convention:
<listener class="" type="post-update"> etc.
Listeners work. When turning on Hibernate SQL logging I can see (writing out of the top of my head now, so <xxx> table names are just for demonstration):
"insert into <MAIN_REV_TABLE>".
"insert into <AUDITED_ENTITY_TABLE_NAME>_AUD... originalId.REV, originalId.id".
but obviously got error.
That's really weird. I remember testing on postgresql and it worked fine. I can't see a reason why mysql or hsql would behave differently than postgresql. Could you create a small testcase and attach it to a jira issue?
I just tested a Seam app with Envers, resource-local transactions and Postgresql 8.4 and it worked fine. Only difference is that I use JPA. Are you able to reproduce the problem with a small testcase?