Re: [HACKERS] text should be a blob field

Поиск
Список
Период
Сортировка
От Peter T Mount
Тема Re: [HACKERS] text should be a blob field
Дата
Msg-id Pine.LNX.3.95.980303195117.25913C-100000@maidast
обсуждение исходный текст
Ответ на Re: [HACKERS] text should be a blob field  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [QUESTIONS] Re: [HACKERS] text should be a blob field  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
On Tue, 3 Mar 1998, Bruce Momjian wrote:

> > make text a blob datatype (maybe storing <= 8k row with tuple, >=8k in blob
> > tablespace)
>
> Hmmm.
>

There was some talk about this about a month ago.

Although we now have blob support in the JDBC driver, there is one
outstanding issue with them, that I was waiting for 6.3 to be released
before starting on it (and almost certainly starting a discussion here
about it).

Allowing text to use blobs for values larger than the current block size
would hit the same problem.

Ok, here's what the problem is at the moment:

The JDBC example ImageViewer uses a table to store the name of an image,
and the OID of the associated blob.

# create table images (imgname name,imgoid oid);

Ok, we now create an entry in the table for an image with:

# insert into images values ('test.gif',lo_import('/home/pmount/test.gif'));

This is fine so far. Now say we delete that row with:

# delete from images where name = 'test.gif';

Fine again, except that the blob is still in the database. To get round
this, you would have to add extra statements to handle this, and for JDBC,
there is no standard way to do this.

What I was thinking of, was to create a new type 'blob' which would delete
the associated large object when the row is deleted. However, here's the
problems against this:

1. Is there a call made by the backend to each datatype when a row is
   deleted? I can't see one.

2. When we update a row, we don't want the overhead of copying a very
   large blob when a row is first copied, then the original deleted, etc.

Anyhow, I'm thinking of various ways around this - just don't hold your
breath ;-)

--
Peter T Mount  petermount@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk


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

Предыдущее
От: Zeugswetter Andreas SARZ
Дата:
Сообщение: AW: [HACKERS] text should be a blob field
Следующее
От: Peter T Mount
Дата:
Сообщение: Re: [HACKERS] backend -> interface communication