]
Diego Pires Plentz resolved HHH-2973.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Rejected
drop table if exists SQL statement is wrong for PostgreSQL
----------------------------------------------------------
Key: HHH-2973
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2973
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.5
Environment: Windows XP, Postgres 8.2.5, Hibernate 3.2.5.ga
Reporter: Carl Allain
Assignee: Diego Pires Plentz
Priority: Minor
I am using hibernate.connection.driver_class = org.postgresql.Driver
When using hibernate.hbm2ddl.auto with create (to get a schema drop + a create)
somewhere, Hibernate generates:
09:15:56,575 DEBUG SchemaExport:303 -
drop table MESSAGES if exists
09:15:56,575 DEBUG SchemaExport:288 - Unsuccessful: drop table MESSAGES if exists
09:15:56,575 DEBUG SchemaExport:289 - ERROR: syntax error at or near "if"
while the 8.2 posgresql doc says:
DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
so it seems the "if exists" is at the wrong place for Postgresql (should be
before the table name, not after)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: