db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DERBY-4011) ALTER COLUMN is only allowed to change default value of some types of generated columns
Date Wed, 17 Sep 2014 11:59:34 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen closed DERBY-4011.
-------------------------------------
    Resolution: Duplicate

DERBY-6545 disallowed modifying the default of an identity column, so now identity columns
and generated columns are handled the same way. Closing this issue as a duplicate.

> ALTER COLUMN is only allowed to change default value of some types of generated columns
> ---------------------------------------------------------------------------------------
>
>                 Key: DERBY-4011
>                 URL: https://issues.apache.org/jira/browse/DERBY-4011
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>              Labels: derby_triage10_10
>
> ALTER TABLE ... ALTER COLUMN is allowed to change the default of columns that are GENERATED
ALWAYS AS IDENTITY, but it's not allowed to change the default of columns that are GENERATED
ALWAYS AS (expression). It would be good if it had the same behaviour for all generated columns.
> ij> create table t1(x int generated always as (-1));
> 0 rows inserted/updated/deleted
> ij> alter table t1 alter column x default 22;
> ERROR 42XA7: 'X' is a generated column. You cannot change its default value.
> ij> create table t2(x int generated always as identity);
> 0 rows inserted/updated/deleted
> ij> alter table t2 alter column x default 22;
> 0 rows inserted/updated/deleted
> ij> insert into t2 values default;
> 1 row inserted/updated/deleted
> ij> select * from t2;
> X          
> -----------
> 22         
> 1 row selected



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message