> Le 2 sept. 2019 à 12:12, Hick Gunter <h...@scigames.at> a écrit :
> 
>> Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
>> Auftrag von Grincheux
>> Into my db I store passwords having differents lengths (from 1 to 50).
>> I don't want to give the max size that woud be using space I don't need.
>> I found that sqlite permits char(0) but what is the incidence for my db.
> Dimensions are ignored by SQLite. A field defined CHAR(0) can hold any length 
> (up to the internal limit) of string. SQlite will only store the actual 
> length of the string plus its contents, no space is wasted.

Grincheux,

As Hick wrote, dimensions are ignored.  You don't even need to use CHAR(0). 
CHAR(1000) or CHAR or TEXT (often used in SQLite schemas) will do and are all 
equivalents.  If CHAR(50) makes sense for you, as a documentation hint that you 
don't expect ever more than 50 characters, then there is nothing wrong leaving 
it as such in your schema. If you want to enforce the 50 characters limit, you 
have to do it either in your code using SQLite OR through some CHECK on the SQL 
definition.

—  
Best Regards, Meilleures salutations, Met vriendelijke groeten, Mit besten 
Grüßen,
Olivier Mascia


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to