[Info-ingres] ALTER TABLE...ALTER COLUMN bug, or no?
Roy Hann
specially at processed.almost.meat
Thu Jan 25 00:19:13 UTC 2018
It seems that changing the size of a character column without explicitly
specifying NOT NULL does not preserve non-nullability. This is
seen in 10.1 and 10.2, on Windows and Solaris (at least).
Keeping in mind the following passage from the SQL Guide about ALTER
TABLE...ALTER COLUMN: "Change the size of a character column to
preserve the existing default_clause, null_clause, column_constraint,
and collation_name", is it a bug? And if it is a bug is it an error
in the code or the documentation?
I say the documentation describes the reasonable behaviour.
Example:
* create table foo ( name varchar(20) not null ) \g
Executing . . .
continue
* commit \g
Executing . . .
continue
* help foo \g
Executing . . .
Name: foo
Owner: roy
Created: 24-jan-2018 19:13:34
Type: user table
Version: II10.0
Column Information:
Key
Column Name Type Length Nulls Defaults Seq
name varchar 20 no no
continue
* alter table foo alter column name varchar(30) \g
Executing . . .
continue
* help foo \g
Executing . . .
Name: foo
Owner: roy
Created: 24-jan-2018 19:13:34
Location: ii_database
Type: user table
Version: II10.0
Column Information:
Key
Column Name Type Length Nulls Defaults Seq
name varchar 30 yes null
Secondary indexes: none
continue
* rollback \g
Executing . . .
continue
* alter table foo alter column name varchar(30) not null \g
Executing . . .
continue
* help foo \g
Executing . . .
Name: foo
Owner: roy
Created: 24-jan-2018 19:13:34
Type: user table
Version: II10.0
Column Information:
Key
Column Name Type Length Nulls Defaults Seq
name varchar 30 no no
continue
*
More information about the Info-ingres
mailing list