pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ruben Rubio <ruben@rentalia.com>
To: pgsql-performance@postgresql.org
Subject: Re: Optimization of this SQL sentence
Date: Wed, 18 Oct 2006 09:06:20 +0200
Message-ID: <4535D26C.1010404@rentalia.com> (raw)
In-Reply-To: <60wt6y7r16.fsf@dba2.int.libertyrms.com>
References: <45349CDF.3090002@rentalia.com>
	<4534A35E.9030909@rentalia.com>
	<181E6D21-8326-4ED6-A9AE-6F9917C1C319@purefiction.net>
	<200610171729.19596.mweilguni@sime.com>
	<b42b73150610170951t33619da0u4851de1fbb1c0b0f@mail.gmail.com>
	<60wt6y7r16.fsf@dba2.int.libertyrms.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1




>> so, imo alexander is correct:
>> contacto varchar(255)

Why do we have limits on this, for example?
contacto varchar(255)

1) First of all, this is a web application. People use to enter really
strange thinks there, and a lot of rubbish. So, as someone commented
before, I am ok with the idea of limit the field.

2) Again, this is a web application. We could just limit the "field
front end length" but this will be not secure. We could limit the field
front end, and limit it with the code that process the data, but is much
secure if we just limit field in database.

Why 255?
This is free field. We are interested in users enter as much data as
needed (with a limit, we no not want "The Quijote" in that field)

People use to imput as spected:
"Contact: Baltolomé Peralez."
But people also inserts thinks as:
"Contact: In the mornings, Bartolomé Perales, in the afternoons Juan
Perales in the same telephone number"

In the context of the application, we are not interested in stopping the
user with a message "Hey, Your contact is too long". We want the user to
go on. That's why 255. We could insert 260. Or maybe 250. But someone
decided 255 and for me its OK.

Please remember that I just put some data of a large applications, and
there is thinks there that has sense in context.




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFNdJsIo1XmbAXRboRAuGVAKCupfXOHwxXOPHFdq+K6S0lXWNZUwCgml1i
CS0eEJcQndEJb7h7Nsfh1CM=
=0gpW
-----END PGP SIGNATURE-----



view thread (24+ messages)  latest in thread

Message-ID: <4535D26C.1010404@rentalia.com>
Permalink:  ../4535D26C.1010404@rentalia.com/
Also on:    postgresql.org/message-id/4535D26C.1010404@rentalia.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: ruben@rentalia.com
  Subject: Re: Optimization of this SQL sentence
  In-Reply-To: <4535D26C.1010404@rentalia.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