On 04/03/15 03:38, Adriano dos Santos Fernandes wrote:
> On 02-04-2015 22:13, Claudio Valderrama C. wrote:
>>> -----Original Message-----
>>> From: Adriano dos Santos Fernandes [mailto:adrian...@gmail.com]
>>> Sent: MiƩrcoles, 01 de Abril de 2015 22:29
>>>
>>> On 31-03-2015 07:41, Alex Peshkoff wrote:
>>>> I.e. we can not override NOT NULL constraint set in the domain.
>>>>
>>> Changed. Thanks.
>> Should we see an error message?
>>
>> F:\fb3dev\fbbuild\firebird30\output_Win32>isql -user sysdba -pass masterkey
>> Use CONNECT or CREATE DATABASE to specify a database
>> SQL> create database "nulls.fdb" user "sysdba" password "masterkey";
>> SQL> create domain notnull int not null;
>> SQL> create table t(a notnull);
>> SQL> alter table t alter a drop not null;
>> SQL> alter table t alter a drop not null;
>> SQL> show table t;
>> A                               (NOTNULL) INTEGER Not Null
>> SQL>
>>
>> The not nullable condition is not overriden, but the engine simply ignores
>> the command.
>>
> If an error is missing, I think it's just about dropping a non existing
> NOT NULL constraint of the field, like this:
>
> SQL> create table t1 (n1 integer);
> SQL> alter table t1 alter n1 drop default;
> Statement failed, SQLSTATE = 42000
> unsuccessful metadata update
> -ALTER TABLE T1 failed
> -Local column N1 doesn't have a default
>
> Otherwise, it's just as we talked. You can drop the column not null if
> it's based on a not null domain, but it will still be not null via the
> domain.
>
> But you can then change the domain after it.
>

Agree with this logic, but it will be useful to add a warning, i.e.

SQL> create table t(a notnull);
SQL> alter table t alter a drop not null;
Warning: Column a based on not null domain
SQL>

Or something like this, may be text is not ideal.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to