Re: text .vs. varchar

From: Martin Gainty <mgainty(at)hotmail(dot)com>
To: Bill Moran <wmoran(at)collaborativefusion(dot)com>, Joao Ferreira <jmcferreira(at)critical-links(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: text .vs. varchar
Date: 2008-08-13 12:54:00
Message-ID: BLU142-W36DF9D0C5A7018EAE2452AAE730@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


With Postgres appears that TEXT is preferred over varchar(N)
http://archives.postgresql.org/pgsql-general/2006-03/msg01522.php

Any other DB (e.g. Oracle) would suggest varchar as column only stores the length of the variable (variable character length..) vs any of the fixed length datatype(s)

Anyone else?
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.

> Date: Wed, 13 Aug 2008 08:45:19 -0400
> From: wmoran(at)collaborativefusion(dot)com
> To: jmcferreira(at)critical-links(dot)com
> CC: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] text .vs. varchar
>
> In response to Joao Ferreira <jmcferreira(at)critical-links(dot)com>:
>
> > Hello all,
> >
> > I have a big database in which much information is stored in TEXT type
> > columns (I did this initially because I did not want to limit the
> > maximum size of the string to be stored)... but...
> >
> > .. let's say I choose an upper limit (p.ex. 200) for the string sizes
> > and I start a fresh database with VARCHAR(200).
> >
> > What tradeoffs can I expect ? disk usage ? query execution times ?
>
> See the "Tip" on this page, it answers your questions:
> http://www.postgresql.org/docs/8.3/static/datatype-character.html
>
> --
> Bill Moran
> Collaborative Fusion Inc.
> http://people.collaborativefusion.com/~wmoran/
>
> wmoran(at)collaborativefusion(dot)com
> Phone: 412-422-3463x4023
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

_________________________________________________________________
Get more from your digital life. Find out how.
http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home2_082008

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2008-08-13 12:54:33 How to analyze the output of debug_print_plan
Previous Message Bill Moran 2008-08-13 12:45:19 Re: text .vs. varchar