[development] type(N) in MySQL numeric type defs in core schema useless

Chris Johnson chris at tinpixel.com
Fri Aug 18 17:21:44 UTC 2006


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.

Agreed.  They are not needed.

The closer we can make database declarations to standard SQL and to a common 
denominator between MySQL and Postgres, the easier our job of supporting 
multiple databases will be.


More information about the development mailing list