Sammy Spets wrote:
> Hi all,
>
> I'm going through the core database code (as part of my role as PostgreSQL maintainer) and have stumbled upon an interesting tidbit.
>
> The use of (N) declarations for integer types in CREATE TABLE statements is useless. From the MySQL manual:
>
> "Another extension is supported by MySQL for optionally specifying the display width of an integer value in parentheses following the base keyword for the type (for example, INT(4)). This optional display width specification is used to left-pad the display of values having a width less than the width specified for the column.
>
> The display width does not constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column."
>
> Given that, why on earth are we even using them? I propose to strip the (N) declaration from core schema files. It'll provide a much quicker path between MySQL and PostgreSQL declarations.
Comment | File | Size | Author |
---|---|---|---|
#1 | mysqlint.patch | 53.17 KB | Chris Johnson |
Comments
Comment #1
Chris Johnson CreditAttribution: Chris Johnson commentedHere's a patch against current HEAD as of 18Aug2006 2114UTC.
Comment #2
chx CreditAttribution: chx commentedNice.
Comment #3
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedSmall question: do the tables need to be updated in hook_update_X()? Eg with an ALTER TABLE to remove it from already existing table schemes. Or doesn't it matter at all that it is there or not?
Comment #4
sammys CreditAttribution: sammys commentedIt doesn't matter if they're there actually. For completeness sake they can be removed.
--
Sammy Spets
Synerger
http://www.synerger.com
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
(not verified) CreditAttribution: commented