Re: [GENERAL] 8k limit

Поиск
Список
Период
Сортировка
От Peter Garner
Тема Re: [GENERAL] 8k limit
Дата
Msg-id 199810271429.AA157878000@piglet.toward.com
обсуждение исходный текст
Ответы Re: [GENERAL] 8k limit  (Mike Meyer <mwm@phone.net>)
Список pgsql-general
Hi!  :-)

>Is there any chance of the 8k tuple limit going away in
>future releases of PostgreSQL? I was working on setting up
>a listserv archive with fields such as sentfrom, date,
>subject, and body, but the content of the body field would
>often exceed 8k because some people are just long-winded.
>I'd really rather not have to deal with the LO interface.

The LO interface is something of a pain, I admit.  In
addition LOBS seem to take a minimum of 16K disk space and
can really slow things down since they are all stored in the
same directory.  (Someone kindly pointed all of these things
out to me in the interfaces mailing list yesterday.)

I have a few ideas that may help.  I am developing an
alternative to libpq++.  It is nowhere near finished but
it does make dealing with LOBs MUCH easier.  Of course you
must be using C++ for this to be of any value. ;-)

What I have decided to do, (I am also developing an article
archiver using postgres), is use both text and LOBS.  I have
a table defined as :

create table Msg_Bodies
(
  Msg_Id                text      not null  ,
  Msg_Oid               OID                 ,
  Msg_Text              text                ,

  primary key ( Msg_Id )

) ;

If the article is longer than 8191 bytes, I create a LOB and
populate the Msg_Oid field with the OID of the LOB.  If the
message is less than 8191 bytes, I simply insert that text
into the Msg_Text field.  When retreiving records, I simply
check whether the oid or the text field is not null and
retreive the text appropriately.  Of course to be really
safe one might define a rule requiring that EITHER the
Msg_Oid or the Msg_Text field be non null.

Thanks

Peter


В списке pgsql-general по дате отправления:

Предыдущее
От: Dan Delaney
Дата:
Сообщение: 8k limit
Следующее
От: Mike Meyer
Дата:
Сообщение: Re: [GENERAL] 8k limit