BLOBs

From: Thomas Swan <tswan(at)olemiss(dot)edu>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: BLOBs
Date: 2001-06-05 21:31:05
Message-ID: 3B1D4F99.7090708@olemiss.edu
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

I know that BLOBs are on the TODO list, but I had an idea.

I think the storage of a BLOB outside of the table is an elegant
solution and keeps table sizes down without the bloat of the stored
object. Granted, if you are searching with a regular expression or
using like or ilike clauses, you're likely to be a little slower but it
shouldn't be by much. More than likely, you won't be searching for
patterns in the BLOB but rather the fields in the table associated with
the BLOB.

Wouldn't it be wonderful if you used the methods you had already
implemented and instead create a behavoir similar to the following.

on an insert
take the data that was to be the blob...
create your externally "to be referenced" file
save the data to the file
store the reference to that file

on an update
take the data that was to be the blob...
create your externally "to be referenced" file
save the data to the file
store the reference to that file
delete the old referenced file

on a delete
delete the reference to your file
delete the external file

I was thinking that the BLOB column type might be a trigger for a macro
that could handle the lo_import, lo_export juggling...

I know it seems overly simplified, but having fought with MySQL and then
trying to wrestle with postgresql and importing,exporting BLOBs, it
seemed there might be a little more room for discussion, although I
doubt this may have added anything to it...

I'd love to see something done with BLOB support during 7.2.x *hint* :)

Besides, if someone could give me some pointers as to where I might be
able to start, I might try to contribute something myself.

Thomas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-06-05 21:54:30 Re: Can the backend return more than one error message per PQexec?
Previous Message Peter Eisentraut 2001-06-05 19:50:38 Can the backend return more than one error message per PQexec?