Re: TEXT and NULL...

From: Herbert Liechti <Herbert(dot)Liechti(at)thinx(dot)ch>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: TEXT and NULL...
Date: 2002-06-17 11:24:42
Message-ID: 3D0DC6FA.1090404@thinx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 17 Jun 2002, Egon Sommer wrote:
> Hallo all,
>
> Does it make any difference to save "no data" in a column with type TEXT or BYTEA as "" (empty string) or null?
> Is one of it faster or more wast of memory?

Always store NULL instead of empty strings. This will it make much
more easier in programming where you don't have to bother about
two conditions (NULL and empty string). An empty string on the
other hand may be a value in an application context where NULL is per
definition always the same. Storing NULL values is a good feature
of DBMS so use it ;-) Querying NULL values is part of the SQL-Syntax.

Best regards
Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti http://www.thinx.ch
ThinX networked business services Adlergasse 5, CH-4500 Solothurn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alessio Bragadini 2002-06-17 11:35:37 Re: Clients for administration?
Previous Message Egon Sommer 2002-06-17 11:17:39 TEXT and NULL...