Re: Optimization of this SQL sentence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Dienstag, 17. Oktober 2006 11:52 schrieb Alexander Staubo:
> Lastly, note that in PostgreSQL these length declarations are not  
> necessary:
>
>    contacto varchar(255),
>    fuente varchar(512),
>    prefijopais varchar(10)
>
> Instead, use:
>
>    contacto text,
>    fuente text,
>    prefijopais text
>
> See the PostgreSQL manual for an explanation of varchar vs. text.

Enforcing length constraints with varchar(xyz) is good database design, not a 
bad one. Using text everywhere might be tempting because it works, but it's 
not a good idea.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux