Re: [GENERAL] maximal length of varchar - Mailing list pgsql-general

From guenther mair
Subject Re: [GENERAL] maximal length of varchar
Date
Msg-id Pine.BSF.3.95q.990624154204.24879A-100000@efferd.nettz.com
Whole thread Raw
In response to Re: [GENERAL] maximal length of varchar  (José Soares <jose@sferacarta.com>)
Responses Re: [GENERAL] maximal length of varchar  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-general
> prova=> create table a1(a varchar(99999));
> ERROR:  length for type 'varchar' cannot exceed 8064
> prova=> create table a1(a varchar(8064));
> CREATE

thanks, for this quick answer!

i did the test by myself and found out, that on the my system (freebsd
3.2) where i do actualy my tests, varchar is limited to 4096. this creates
the problem of plattfrom dependence.

what length has the text field?
-> i tried a insert-command with some 10000 signs for one text-field
-> i got a "PQsendQuery() -- query is too long.  Maximum length is 8191"

hmpf. so maximum length may not exceed 8191 signs in any case. this causes
textfields to be reduced to a variable length, which depends on the amount
of your table-fields; just think of these two cases:

a table with 50 fields and a realy big textfield

a table with 2 fields where one is a realy big textfield

in the first case the textfield has to be smaller, since i can't exceed
the maximum query length of 8191 signs.....

now what? :)

thanks,



guenther


pgsql-general by date:

Previous
From: José Soares
Date:
Subject: Re: [GENERAL] maximal length of varchar
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Limitation