ERROR: syntax error at or near "user" ERROR: syntax error at or near "user" postgresql postgresql

ERROR: syntax error at or near "user"


user is a reserved keyword in PostgreSQL. It is allowed only as quoted identifier.

You have to force Hibernate to use quoted "user" in this INSERT command.

I'm not Hibernate expert but maybe this Hibernate saving User model to Postgres will help?


I'm a bit confused are you referring to a column or table named User... You can use the @Table-annotation to set the table name for the entity in JPA:

@Entity@Table(name = "XonamiUser")public class User extends PropertyContainer {


In the end, I refactored the class user to XonamiUser. This wasn't quite what I wanted, but it worked great.