db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r347987 - in /db/ddlutils/trunk/src: java/org/apache/ddlutils/platform/PostgreSqlBuilder.java test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java
Date Mon, 21 Nov 2005 21:22:24 GMT
Author: tomdz
Date: Mon Nov 21 13:22:14 2005
New Revision: 347987

URL: http://svn.apache.org/viewcvs?rev=347987&view=rev
Log:
Fix for DDLUTILS-49

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PostgreSqlBuilder.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PostgreSqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PostgreSqlBuilder.java?rev=347987&r1=347986&r2=347987&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PostgreSqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PostgreSqlBuilder.java Mon Nov
21 13:22:14 2005
@@ -97,9 +97,9 @@
      */
     protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
     {
-        print("UNIQUE DEFAULT nextval(");
-        printIdentifier(getConstraintName(null, table, column.getName(), "seq"));
-        print(")");
+        print("UNIQUE DEFAULT nextval('");
+        print(getConstraintName(null, table, column.getName(), "seq"));
+        print("')");
     }
 
     /**
@@ -124,9 +124,9 @@
                 {
                     result.append(", ");
                 }
-                result.append("CURRVAL(");
-                result.append(getDelimitedIdentifier(getConstraintName(null, table, columns[idx].getName(),
"seq")));
-                result.append(") AS ");
+                result.append("currval('");
+                result.append(getConstraintName(null, table, columns[idx].getName(), "seq"));
+                result.append("') AS ");
                 result.append(getDelimitedIdentifier(columns[idx].getName()));
             }
             return result.toString();

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java?rev=347987&r1=347986&r2=347987&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestPostgresqlPlatform.java Mon
Nov 21 13:22:14 2005
@@ -93,11 +93,11 @@
             "CREATE TABLE \"constraints\"\n"+
             "(\n"+
             "    \"COL_PK\"               VARCHAR(32),\n"+
-            "    \"COL_PK_AUTO_INCR\"     INTEGER UNIQUE DEFAULT nextval(\"constraints_COL_K_AUTO_INCR_seq\"),\n"+
+            "    \"COL_PK_AUTO_INCR\"     INTEGER UNIQUE DEFAULT nextval('constraints_COL_K_AUTO_INCR_seq'),\n"+
             "    \"COL_NOT_NULL\"         BYTEA NOT NULL,\n"+
             "    \"COL_NOT_NULL_DEFAULT\" DOUBLE PRECISION DEFAULT '-2.0' NOT NULL,\n"+
             "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
-            "    \"COL_AUTO_INCR\"        BIGINT UNIQUE DEFAULT nextval(\"constraints_COL_AUTO_INCR_seq\"),\n"+
+            "    \"COL_AUTO_INCR\"        BIGINT UNIQUE DEFAULT nextval('constraints_COL_AUTO_INCR_seq'),\n"+
             "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
             ");\n",
             createTestDatabase(COLUMN_CONSTRAINT_TEST_SCHEMA));



Mime
View raw message