Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B48018427 for ; Sat, 9 Apr 2016 16:42:26 +0000 (UTC) Received: (qmail 32578 invoked by uid 500); 9 Apr 2016 16:42:25 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 32552 invoked by uid 500); 9 Apr 2016 16:42:25 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 32540 invoked by uid 99); 9 Apr 2016 16:42:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2016 16:42:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 888542C1F5A for ; Sat, 9 Apr 2016 16:42:25 +0000 (UTC) Date: Sat, 9 Apr 2016 16:42:25 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6882) Add functionality to ALTER TABLE: switch from GENERATED ALWAYS to GENERATED BY DEFAULT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15233625#comment-15233625 ] Bryan Pendleton commented on DERBY-6882: ---------------------------------------- Upgrade10_13 passed without incident when run as part of the full upgrade suite. > 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 > > > 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)