pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed[PERFORMANCE] Beetwen text and varchar field
3+ messages / 3 participants
[nested] [flat]
* [PERFORMANCE] Beetwen text and varchar field
@ 2006-01-09 10:58 TNO <tnodev@free.fr>
2006-01-09 11:49 ` Re: [PERFORMANCE] Beetwen text and varchar field Steinar H. Gunderson <sgunderson@bigfoot.com>
0 siblings, 1 reply; 3+ messages in thread
From: TNO @ 2006-01-09 10:58 UTC (permalink / raw)
To: pgsql-performance
Hello
what is the best for a char field with less than 1000 characters?
a text field or a varchar(1000)
thanks
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [PERFORMANCE] Beetwen text and varchar field
2006-01-09 10:58 [PERFORMANCE] Beetwen text and varchar field TNO <tnodev@free.fr>
@ 2006-01-09 11:49 ` Steinar H. Gunderson <sgunderson@bigfoot.com>
2006-01-09 23:50 ` Re: [PERFORMANCE] Beetwen text and varchar field Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Steinar H. Gunderson @ 2006-01-09 11:49 UTC (permalink / raw)
To: TNO <tnodev@free.fr>; +Cc: pgsql-performance
On Mon, Jan 09, 2006 at 11:58:19AM +0100, TNO wrote:
> what is the best for a char field with less than 1000 characters?
> a text field or a varchar(1000)
They will be equivalent. text and varchar are the same type internally -- the
only differences are that varchar can have a length (but does not need one),
and that some casts are only defined for text.
If there's really a natural thousand-character limit to the data in question,
use varchar(1000); if not, use text or varchar, whatever you'd like.
/* Steinar */
--
Homepage: http://www.sesse.net/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [PERFORMANCE] Beetwen text and varchar field
2006-01-09 10:58 [PERFORMANCE] Beetwen text and varchar field TNO <tnodev@free.fr>
2006-01-09 11:49 ` Re: [PERFORMANCE] Beetwen text and varchar field Steinar H. Gunderson <sgunderson@bigfoot.com>
@ 2006-01-09 23:50 ` Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Momjian @ 2006-01-09 23:50 UTC (permalink / raw)
To: Steinar H. Gunderson <sgunderson@bigfoot.com>; +Cc: TNO <tnodev@free.fr>; pgsql-performance
See the FAQ.
---------------------------------------------------------------------------
Steinar H. Gunderson wrote:
> On Mon, Jan 09, 2006 at 11:58:19AM +0100, TNO wrote:
> > what is the best for a char field with less than 1000 characters?
> > a text field or a varchar(1000)
>
> They will be equivalent. text and varchar are the same type internally -- the
> only differences are that varchar can have a length (but does not need one),
> and that some casts are only defined for text.
>
> If there's really a natural thousand-character limit to the data in question,
> use varchar(1000); if not, use text or varchar, whatever you'd like.
>
> /* Steinar */
> --
> Homepage: http://www.sesse.net/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-01-09 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-09 10:58 [PERFORMANCE] Beetwen text and varchar field TNO <tnodev@free.fr>
2006-01-09 11:49 ` Steinar H. Gunderson <sgunderson@bigfoot.com>
2006-01-09 23:50 ` Bruce Momjian <pgman@candle.pha.pa.us>
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