create table with text not null

Ivan Smahin ivan_smahin at paradigmasoft.com
Fri Jun 13 06:03:13 CDT 2008


Hello Erich,

Friday, June 13, 2008, 1:16:23 PM, you wrote:

> The following statement:

> CREATE TABLE "TEST_T2" (
>     "ID" SHORT  NOT NULL INDEXED,
>     "Description" TEXT (512) NOT NULL,
>     "Point" VARCHAR (12)  NOT NULL);

> should create a table with field "description" being defined as not 
> containing NULL values, right?.
> Is there something wrong with that statement?

> Dumping that table results in:

> -- Dump for 'TEST_T2' table
> ----------------------------------------------------

> CREATE TABLE "TEST_T2" (
>     "ID" SHORT  NOT NULL INDEXED,
>     "Description" TEXT (512) ,
>     "Point" VARCHAR (12)  NOT NULL);

> ???

Internally having nulls in text or blob fields costs nothing.
Moreover it is much more effective to store null instead of "empty"
value. So on this point it is no sense to create text field as
not nullable. Any blob field just ignore "NOT NULL" request. They are
always nullable.

On the other hand - ability to take null-values is sort of constraint
and it could be used in this meaning.

Well, seems we have to turn on "create not-nullable blob" ability.
Anyway - put it to the Mantis please.


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list