db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Van Couvering <David.Vancouver...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-119) Add ALTER TABLE option to change column from NULL to NOT NULL
Date Tue, 05 Sep 2006 16:58:59 GMT
I too am bummed this feature didn't make it in, but it just didn't make 
it to the station on time and the doors shut before it could jump on.

Sorry to say that it is a general policy (AFAIK) not to add new features 
to maintenance branch such as 10.1.  People in production with Derby 
don't like potentially destabilizing features such as this added to a 
maintenance release which is supposed to be just about bug-fixes.

Since this did not make the cut for 10.2, this feature won't see the 
light of day until 10.3, which probably won't happen for another six 
months.  However, hopefully we'll be making snapshots/drops available of 
the 10.3 release early and often.  Even these snapshots (and even our 
nightly builds) are generally quite well tested so depending on what 
you're doing you can probably start working with it fairly soon.  I 
regularly work with the latest build off the codeline and am quite happy 
with its stability (but then I'm not running it in production...)


David Heath (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/DERBY-119?page=comments#action_12432604 ]

> David Heath commented on DERBY-119:
> -----------------------------------
> Do you have an idea when this feature will make it into a non-alpha release - will it
make it into 10.1 branch?
> Derby is one of the DBMS we use in our application and currently we are working on tools
to help in the migration of our data model from one version to the next. In doing so, I am
hoping to have the ability to change the NULL constraint on a column. I had assumed Derby
already supported this behavior and only discovered yesterday that its is a new feature and
has only made it into the 10.2 branch.
>> Add ALTER TABLE option to change column from NULL to NOT NULL
>> -------------------------------------------------------------
>>                 Key: DERBY-119
>>                 URL: http://issues.apache.org/jira/browse/DERBY-119
>>             Project: Derby
>>          Issue Type: New Feature
>>          Components: SQL
>>            Reporter: Bernd Ruehlicke
>>         Assigned To: Bryan Pendleton
>>             Fix For:
>>         Attachments: alterColumnNotNull_1.diff, alterColumnNotNull_v2.diff, alterColumnNotNull_v3.diff
>> There was a thread about this on the Cloudscape forum
>> http://www-106.ibm.com/developerworks/forums/dw_thread.jsp?message=4103269&cat=19&thread=59941&forum=370#4103269
>> Since this describes the problem I will just copy the content of this entry as my
>> The content of this was 
>> "
>> Hi,
>> I stumbled across a behaviour of cloudscape which is not a bug but IMHO an implementation
choice. To assign a primary key to a table using ALTER TABLE all columns must be declared
NOT NULL first, which can only be specified upon column creation (no ALTER TABLE statement
exists to change the NOT NULL property of a column).
>> Most databases I know do two things differently:
>> 1) when a primary key is assigned all pk columns are automatically set to NOT NULL,
if one of them contains NULL values, the ALTER TABLE statement fails
>> 2) it is possible to alter the column to set the NOT NULL property after column creation
(fails when there are already records containing NULL values)
>> If I have understood the limitations correctly in Cloudscape I have no choice but
to remove and re-add the column which is supposed to be used in the primary key, if it is
not already declared as NOT NULL. This means that in the case of a table containing valid
data (unique and not null) in the column in all records, I would have to export the data,
remove and re-add the column and reimport that data, which would not be necessary e.g. in
Oracle or MaxDB.
>> Is it possible to change that behaviour or is there a good reason for it? It looks
as if it makes the life of the user more difficult than necessary for certain metadata manipulations.
Making it possible to alter the NOT NULL property of a column would solve this and IMHO having
a primary key constraint do this implicitly makes sense as well. 
>> Thanks in advance for any insight on this,
>> Robert"

View raw message