[
https://issues.apache.org/jira/browse/DDLUTILS-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579886#action_12579886
]
cordeo edited comment on DDLUTILS-199 at 6/3/08 7:03 AM:
-------------------------------------------------------------------
Even better:
print("UNIQUE DEFAULT nextval('"); // unchanged
printIdentifier(getConstraintName(null, table, column.getName(),
"seq"));
print("')"); // unchanged
This (of course) also applies to the currval function in
getSelectLastIdentityValues():
result.append("currval('"); // unchanged
result.append(getDelimitedIdentifier(getConstraintName(null, table,
columns[idx].getName(), "seq")));
result.append("') AS "); // unchanged
result.append(getDelimitedIdentifier(columns[idx].getName())); // unchanged
was (Author: cordeo):
This (of course) also applies to the currval function in
getSelectLastIdentityValues():
result.append("currval('\"");
result.append(getConstraintName(null, table, columns[idx].getName(), "seq"));
result.append("\"') AS ");
result.append(getDelimitedIdentifier(columns[idx].getName()));
> Postgress AutoIncrement fails
> -----------------------------
>
> Key: DDLUTILS-199
> URL: https://issues.apache.org/jira/browse/DDLUTILS-199
> Project: DdlUtils
> Issue Type: Bug
> Components: Core - PostgreSql
> Affects Versions: 1.0
> Environment: Ubuntu 7.10, PostgreSQL 8.2.6
> Reporter: Rijk van Haaften
> Assignee: Thomas Dudziak
> Fix For: 1.1
>
> Original Estimate: 0.17h
> Remaining Estimate: 0.17h
>
> class org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder
> writeColumnAutoIncrementStmt(Table, Column)
> encloses the parameter of nextval in single quotes.
> print("UNIQUE DEFAULT nextval('");
> ...
> print("')");
> which in my case generates
> UNIQUE DEFAULT nextval('Entity_id_seq')
> The underscore is a 'special' character, so the string Entity_id_seq needs to
> be in double quotes. The fix is simple but tricky: the single quotes MUST
> remain! My local fix (notice the escaped double quote \" twice):
> /**
> * [EMAIL PROTECTED]
> */
> protected void writeColumnAutoIncrementStmt(Table table, Column column)
> throws IOException
> {
> print("UNIQUE DEFAULT nextval('\"");
> print(getConstraintName(null, table, column.getName(), "seq"));
> print("\"')");
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.