db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Fedorenko" <afedo...@informex.net>
Subject RE: [ANN] Torque 3.0.1 released, PostgreSQL changes
Date Fri, 06 Jun 2003 09:44:03 GMT
It seems that nobody has provided a test case - this makes it hard for 
the developers to confirm that the patch is correct.


Changes to PostgreSQL adapter :


1.  LIMIT style 

    REASON :
 
    LIMIT #,# has been disabled; use LIMIT # OFFSET #. : from PosgreSQL
doc

    The new style is in use from 7.3 PostgreSQL release .
        


java.sql.SQLException: ERROR:  LIMIT #,# syntax not supported.
	Use separate LIMIT and OFFSET clauses.
	at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:126)
	at
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connec
tion.java:451)
....
rethrown as org.apache.torque.TorqueException: ERROR:  LIMIT #,# syntax
not supported.
	Use separate LIMIT and OFFSET clauses.
	at
org.apache.torque.util.BasePeer.executeQuery(BasePeer.java:1502)
	at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1321)


Code in class org.apache.torque.util.BasePeer

                case DB.LIMIT_STYLE_POSTGRES :
                    limitString =
                        new StringBuffer()
                            .append(limit)
                            .append(" , ")
                            .append(offset)
                            .toString();


should be replaced with

                case DB.LIMIT_STYLE_POSTGRES :
                    limitString =
                        new StringBuffer()
                            .append(limit)
                            .append(" OFFSET ")
                            .append(offset)
                            .toString();


2.  DROP TABLE command

    ... from PostgreSQL documentation

    DROP TABLE always removes any indexes, rules, triggers, and
constraints that exist for the target table. However, to drop a table
that is referenced by a foreign-key constraint of another table, CASCADE
must be specified. (CASCADE will remove the foreign-key constraint, not
the other table itself.)  


Code in file src\templates\sql\base\postgresql\drop.vm

DROP TABLE $table.Name;

Should be replaced with

DROP TABLE $table.Name CASCADE ;




Mime
View raw message