Re: Large objects. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Large objects.
Date
Msg-id AANLkTi=9RGkFExVkjhMHjzdJWRsg4x8_VEW67E7piKPa@mail.gmail.com
Whole thread Raw
In response to Re: Large objects.  (Dmitriy Igrishin <dmitigr@gmail.com>)
List pgsql-hackers
On Mon, Sep 27, 2010 at 2:25 PM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> Hey Robert, Tom
>
> Tom, thank you for explanation!
>
>> Ouch.  Letting people write data to where they can't get it back from
>> seems double-plus ungood.
>>
> Robert, yes, I agree with you. This is exactly what I wanted to say.
> I've implemented a stream class in C++ and this circumstance makes
> the code not so clean because I need to take into account the behavior
> of lo_write() and 2GB limit.

On further examination, it appears we're not doing this.  The reason
lo_read wasn't returning any data in your earlier example is because
you called it after seeking to the end of the object.  If you seek to
the position where the data was written, it works fine.

A fairly plausible argument could be made that we shouldn't allow
reading or writing past 2^31-1, but it now appears to me that the
behavior is at least self-consistent.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: trailing whitespace in psql table output
Next
From: Itagaki Takahiro
Date:
Subject: Re: Help with User-defined function in PostgreSQL with Visual C++