pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Weilguni <mweilguni@sime.com>
To: pgsql-performance@postgresql.org
Cc: Alexander Staubo <alex@purefiction.net>
Cc: Ruben Rubio <ruben@rentalia.com>
Subject: Re: Optimization of this SQL sentence
Date: Tue, 17 Oct 2006 17:29:19 +0200
Message-ID: <200610171729.19596.mweilguni@sime.com> (raw)
In-Reply-To: <181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net>
References: <45349CDF.3090002@rentalia.com>
	<4534A35E.9030909@rentalia.com>
	<181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net>

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.



view thread (24+ messages)  latest in thread

Message-ID: <200610171729.19596.mweilguni@sime.com>
Permalink:  ../200610171729.19596.mweilguni@sime.com/
Also on:    postgresql.org/message-id/200610171729.19596.mweilguni@sime.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mweilguni@sime.com, alex@purefiction.net, ruben@rentalia.com
  Subject: Re: Optimization of this SQL sentence
  In-Reply-To: <200610171729.19596.mweilguni@sime.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox