>Hi all,
>
>is it possible to change a nullable column to not-nullable with Ingres
>2006's ALTER TABLE... ALTER COLUMN... command?
>
>If yes, how would this look like?
Converting a column from nullable to non-nullable is explicitly
checked for and disallowed. I'm not 100% sure why, I suppose
it's because there would be no real good way of dealing with
an existing NULL at runtime. I think I would prefer to see
it allowed, and convert existing NULL to default; however
this is arguably less "correct".
I guess you will have to drop and re-add the column.
If the table involved doesn't have a unique key, you could
temporarily add a holding column to that table and update
it with the old column's values while you drop and recreate
the old column.
Karl
Gerhard Hofmann - 18 Jan 2008 19:11 GMT
On 18 Jan., 15:36, Karl & Betty Schendel <schen...@kbcomputer.com>
wrote:
> Converting a column from nullable to non-nullable is explicitly
> checked for and disallowed. I'm not 100% sure why, I suppose
[quoted text clipped - 10 lines]
>
> Karl
Hello Karl,
thanks for your helpful explanation. I supposed it wouldn't work. We
already use the proposed workaround with copying the data into a
temporary / holding column.
Regards
Gerhard