[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2973) drop table if exists SQL statement is wrong for PostgreSQL

Carl Allain (JIRA) noreply at atlassian.com
Tue Nov 27 09:33:56 EST 2007


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
            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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list