Unix Technical Forum

Maximum text and bytea size?

This is a discussion on Maximum text and bytea size? within the pgsql Admins forums, part of the PostgreSQL category; --> Hello, I'm not sure if I understand documentation the right way. Is the maximum size for text and bytea ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 06:15 AM
Ludek Finstrle
 
Posts: n/a
Default Maximum text and bytea size?

Hello,

I'm not sure if I understand documentation the right way.
Is the maximum size for text and bytea types 2^30-1 bytes?
I read this value in TOAST section. Is my opinion correct?

Thanks,

Luf

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 06:15 AM
Jim C. Nasby
 
Posts: n/a
Default Re: Maximum text and bytea size?

On Thu, Jun 08, 2006 at 11:18:02AM +0200, Ludek Finstrle wrote:
> Hello,
>
> I'm not sure if I understand documentation the right way.
> Is the maximum size for text and bytea types 2^30-1 bytes?
> I read this value in TOAST section. Is my opinion correct?


From http://www.postgresql.org/docs/8.1/i...ge-toast.html:
"TOAST usurps the high-order two bits of the varlena length word,
thereby limiting the logical size of any value of a TOAST-able data type
to 1Gb (2^30 - 1 bytes)."

There was a proposal made some time ago to allow for a variable-length
length word format, where one of the bits in each word would specify
that there was an additional length word. That would theoretically allow
for an unlimited size on verlena columns. I don't remember what the
outcome of that discussion was, though. You should be able to find it in
the archives with enough digging.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 06:15 AM
Tom Lane
 
Posts: n/a
Default Re: Maximum text and bytea size?

"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Thu, Jun 08, 2006 at 11:18:02AM +0200, Ludek Finstrle wrote:
>> I read this value in TOAST section. Is my opinion correct?


> From http://www.postgresql.org/docs/8.1/i...ge-toast.html:
> "TOAST usurps the high-order two bits of the varlena length word,
> thereby limiting the logical size of any value of a TOAST-able data type
> to 1Gb (2^30 - 1 bytes)."


> There was a proposal made some time ago to allow for a variable-length
> length word format, where one of the bits in each word would specify
> that there was an additional length word.


Hm, I don't remember that. It seems rather pointless, as I'm quite sure
that the *practical* limit is a great deal less than 1Gb. Has anyone
done any performance testing of GB-sized toasted values?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 06:15 AM
Jim C. Nasby
 
Posts: n/a
Default Re: Maximum text and bytea size?

On Thu, Jun 08, 2006 at 11:55:02AM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jnasby@pervasive.com> writes:
> > On Thu, Jun 08, 2006 at 11:18:02AM +0200, Ludek Finstrle wrote:
> >> I read this value in TOAST section. Is my opinion correct?

>
> > From http://www.postgresql.org/docs/8.1/i...ge-toast.html:
> > "TOAST usurps the high-order two bits of the varlena length word,
> > thereby limiting the logical size of any value of a TOAST-able data type
> > to 1Gb (2^30 - 1 bytes)."

>
> > There was a proposal made some time ago to allow for a variable-length
> > length word format, where one of the bits in each word would specify
> > that there was an additional length word.

>
> Hm, I don't remember that. It seems rather pointless, as I'm quite sure
> that the *practical* limit is a great deal less than 1Gb. Has anyone
> done any performance testing of GB-sized toasted values?


Given how toasted data is currently stored, you're probably correct. If
it was switched to a binary format that didn't have all the table/tuple
overheard (which I seem to recall a discussion about), it could be a
very different story.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:44 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com