Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] maximal length of varchar

From: guenther mair <mairg(at)efferd(dot)nettz(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] maximal length of varchar
Date: 1999-06-24 13:51:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
> prova=> create table a1(a varchar(99999));
> ERROR:  length for type 'varchar' cannot exceed 8064
> prova=> create table a1(a varchar(8064));

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? :)



In response to


pgsql-general by date

Next:From: Bruce MomjianDate: 1999-06-24 15:39:40
Subject: Re: [GENERAL] Limitation
Previous:From: José SoaresDate: 1999-06-24 13:25:53
Subject: Re: [GENERAL] maximal length of varchar

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group