[
https://issues.apache.org/jira/browse/DERBY-6882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255260#comment-15255260
]
Rick Hillegas edited comment on DERBY-6882 at 4/23/16 2:16 PM:
---------------------------------------------------------------
Hi Aleksei,
Thanks for the feedback. Glad to hear that the feature works for you. The
additional behavior which you requested is not part of the 2011 Standard
behavior described in part 2, section 11.20 (<alter identity column
specification>). I can see that it would be convenient for your use-case.
However, I can imagine cases in which it is not the correct default behavior. I
think that the Standard is prudent to remain silent on this topic. You are
welcome to open another, follow-on enhancement request for this extra behavior.
The workaround (ALTER TABLE ... RESTART) seems adequate to me, so I don't plan
to work on that enhancement.
You probably did not see the doc changes I made. For some reason, the alpha
docs are not being generated. Please take a look at the
derby-6883-01-aa-refManualChanges.tar attached to DERBY-6883. The workaround is
demonstrated in the final example at the bottom of the ALTER TABLE topic. If
you have suggestions about how to improve the documentation of this feature,
please add your comments to DERBY-6883.
Thanks,
-Rick
was (Author: rhillegas):
Hi Aleksei,
Thanks for the feedback. Glad to hear that the feature works for you. The
additional behavior which you requested is not part of the 2011 Standard
behavior described in part 2, section 11.20 (<alter identity column
specification>). I can see that it would be convenient for your use-case. You
are welcome to open another, follow-on enhancement request for this extra
behavior. The workaround (ALTER TABLE ... RESTART) seems adequate to me, so I
don't plan to work on that enhancement.
You probably did not see the doc changes I made. For some reason, the alpha
docs are not being generated. Please take a look at the
derby-6883-01-aa-refManualChanges.tar attached to DERBY-6883. The workaround is
demonstrated in the final example at the bottom of the ALTER TABLE topic. If
you have suggestions about how to improve the documentation of this feature,
please add your comments to DERBY-6883.
Thanks,
-Rick
> Add functionality to ALTER TABLE: switch from GENERATED ALWAYS to GENERATED
> BY DEFAULT
> --------------------------------------------------------------------------------------
>
> Key: DERBY-6882
> URL: https://issues.apache.org/jira/browse/DERBY-6882
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.12.1.1
> Reporter: Aleksei Kovura
> Assignee: Rick Hillegas
> Labels: features
> Attachments: derby-6882-01-aa-initialCode.diff,
> derby-6882-01-bb-withTests.diff, derby-6882-02-aa-port_1738368_to_10.12.diff
>
>
> I'm trying to import data from another Derby database with foreignViews tool
> because system tables got corrupted somehow (see
> https://issues.apache.org/jira/browse/DERBY-6876). Tables contain generated
> ID columns (created as "GENERATED ALWAYS"). Importing data and allowing Derby
> to generate new IDs in generated columns will break relationships between
> tables (old tables have counter gaps there due to deletes - IDs won't match).
> For a clean import without breaking DDL information in DB version control I
> would like to be able to switch between generated types as follows:
>
> ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED BY DEFAULT [ AS IDENTITY]
> ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED ALWAYS [ AS IDENTITY]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)