db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: NullPointerException in Derby 10.9.1.0
Date Tue, 04 Dec 2012 22:08:17 GMT
Kim Haase <camilla.haase@oracle.com> writes:

> Should I file a doc JIRA to clarify that ALTER TABLE adds the new
> column at the end?

That would be great.

> It seems obvious, but perhaps we should clarify
> that a programmatic attempt to change the data type of a column will
> still result in the changed column being appended.
>
> I notice it is possible to change the data type of a column using
> "ALTER TABLE ALTER column-name SET DATA TYPE", but you can only change
> the type to VARCHAR or VARCHAR FOR BIT DATA. Do you know why that is?

We probably only allow changing the maximum length of columns that
already are VARCHAR or VARCHAR FOR BIT DATA. Since changing the maximum
length can be done in the table meta-data without changing the stored
format of each value, that's easier to support than the general case.
For example, changing the type from INT to DOUBLE would require an
update of every row in the table, since they have different formats.
That's my guess, at least.

-- 
Knut Anders

Mime
View raw message