Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 84543 invoked from network); 7 Nov 2006 22:57:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 22:57:22 -0000 Received: (qmail 30083 invoked by uid 500); 7 Nov 2006 22:57:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 30014 invoked by uid 500); 7 Nov 2006 22:57:27 -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 29972 invoked by uid 99); 7 Nov 2006 22:57:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 14:57:27 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 14:57:15 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5AE507142F6 for ; Tue, 7 Nov 2006 14:56:55 -0800 (PST) Message-ID: <27443269.1162940215369.JavaMail.jira@brutus> Date: Tue, 7 Nov 2006 14:56:55 -0800 (PST) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1515) Provide ALTER TABLE functionality to change a column's data type In-Reply-To: <27729253.1153067233828.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DERBY-1515?page=comments#action_12447952 ] Bryan Pendleton commented on DERBY-1515: ---------------------------------------- Knut Anders pointed out that it isn't necessary to rename column c1 to c1_oldtype. The technique can be simplified to: 1) ALTER TABLE t ADD COLUMN c1_newtype NEWTYPE; 2) UPDATE t SET c1_newtype = c1; 3) ALTER TABLE t DROP COLUMN c1; 4) ALTER TABLE t RENAME COLUMN c1_newtype to c1; > Provide ALTER TABLE functionality to change a column's data type > ---------------------------------------------------------------- > > Key: DERBY-1515 > URL: http://issues.apache.org/jira/browse/DERBY-1515 > Project: Derby > Issue Type: New Feature > Components: Documentation, SQL > Affects Versions: 10.1.1.0, 10.2.1.6, 10.1.2.1, 10.1.3.1 > Reporter: Bryan Pendleton > Priority: Minor > > Derby should provide a feature which allows a user to change the data type of an existing column in an existing table. > Currently, there exists the statement: > ALTER TABLE tablename ALTER COLUMN columnname SET DATA TYPE datatype > However, this statement currently only allows increasing the length of a VARCHAR column. You are not allowed to decrease the width or to change the data type. > It would be nice if this restriction could be lifted, and the datatype could be changed. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira