Re: index row requires 10040 bytes, maximum size is 8191

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Michael Shepanski <michael(dot)shepanski(at)netpage(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: index row requires 10040 bytes, maximum size is 8191
Date: 2011-09-19 06:14:14
Message-ID: CAOR=d=1sf_wQP80NsvVYJS4dOg=2e11A8k=Va8b1LBuPfOfQ3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 18, 2011 at 11:07 PM, Michael Shepanski
<michael(dot)shepanski(at)netpage(dot)com> wrote:
> Craig Ringer writes:
>>
>>Thoughts, folks? Does this matter in practice, since anything you'd
>> want to index will in practice be small enough or a candidate for
>> full-text indexing?
>
> Here's my case: the field is meant to hold a person's name, so it's
> usually well under the 8191-byte limit.  I want it indexed so that I can
> sort on it quickly.  I also want it to be robust against abuse, so if
> someone does enter the text of _War and Peace_ as their name,
> I want to handle that gracefully.
>
> I can achieve that by my own programming, outside of postgresql,
> and that's fine if I'm the only one who has gotten into this fix.  Otoh
> if it's a common problem then there's a reason why removing the
> limitation might matter in practice.

What if someone enters the text of war and piece * 1,000,000,000 or
so? or * 10E26 or something. There has to be a limit where you tell
the user, usually sooner rather than later, that some size is just too
big. And in the case of a name field, 1,000 is probably a
realistically high enough max that it should never be a problem,
unless the name is one of the candidates for the very silly party.
Allowing users to input some great big huge chunk of text is opening
yourself up to a denial of service scenario. someone writes a bot
that submits names of 100M over and over, and watch the system just
fall over from network, io, or memory overload.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2011-09-19 06:19:18 Re: duplicate sequence, it is possible?
Previous Message Venkat Balaji 2011-09-19 05:10:54 Re: warm standby - apply wal archives