Silly Question about varchar(n)

Поиск
Список
Период
Сортировка
Искать

Silly Question about varchar(n)

От:
Derek Clarkson <dhc@bigpond.net.au>
Дата:
Hi guys,
	Whats maximum I can put as the length ? - I can't find it in the doco.

Thanks.
-- 
Derek Clarkson
Web: http://users/bigpond/net/au/drekka

Re: Silly Question about varchar(n)

От:
"paul butler" <paul@entropia.co.uk>
Дата:
From:           	Derek Clarkson 
To:             	pgsql-novice@postgresql.org
Subject:        	[NOVICE] Silly Question about varchar(n)
Date sent:      	Wed, 29 Jan 2003 17:03:23 +1100


No maximum 
(practically, there may be a limit, but I have never exceeded it) 
if you use varchar()
otherwise specifed by number, e g varchar(100)
For extra safety and speed use text datatype,
though this may cause odbc hiccups if that is part of your plans
> Hi guys,
> 	Whats maximum I can put as the length ? - I can't find it in the doco.
> 
> Thanks.
> -- 
> Derek Clarkson
> Web: http://users/bigpond/net/au/drekka
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

HTH

Paul Butler

Re: Silly Question about varchar(n)

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Derek Clarkson  writes:
> 	Whats maximum I can put as the length ? - I can't find it in the doco.

I think the parser will complain about N exceeding 10,000,000.

In practice, if you don't have a clear idea of what the upper bound
should be, don't put an upper bound --- use type text.  Putting a
meaninglessly large upper bound simply wastes cycles for useless checks.

			regards, tom lane
FAQ