Re: [GENERAL] Using BLOBs with PostgreSQL

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Martin A(dot) Marques" <martin(at)math(dot)unl(dot)edu(dot)ar>
Cc: Tim Kientzle <kientzle(at)acm(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Using BLOBs with PostgreSQL
Date: 2000-10-09 18:21:03
Message-ID: 200010091821.OAA22351@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> On Sat, 07 Oct 2000, Tim Kientzle wrote:
> >
> > I've been using MySQL for initial development; it has pretty
> > clean and easy-to-use BLOB support. You just declare a BLOB
> > column type, then read and write arbitrarily large chunks of data.
> > In Perl, BLOB columns work just like varchar columns; in JDBC,
> > the getBinaryStream()/setBinaryStream() functions provide support
> > for streaming large data objects.
>
> If you're talking about BLOB texts, just declare the column as text and thats
> all. In the case of binary data, I don't have an idea. I only work we text
> data.

[General CC removed, hackers CC added.]

Yes, this opens a good question. We have long text fields, and bytea for
binary input with escapes. As far as I know, we can store binary values
in text fields, but we have no way of getting them in there via SQL
queries (except for bytea using escapes for the binary values).

Should be look at extending along some type of large-object style API to
get binary values into these fields? Do we create a BLOB type that can
take a file name like large objects? Seems we shouldn't use TEXT for
binary if we can help it because it is confusing, and a BLOB type would
allow selects on BLOB type to return nothing rather than blasting binary
data into the user's terminal.

When we had the 8k limit, no one would really wanted to store binary
data in there because most binary values are >8k, but now that we can
store them, should we make a way for users to get them into TOAST
values.

I have on the TODO list already:

* Add non-large-object binary field

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-10-09 18:21:28 Re: Table locks
Previous Message Bruce Momjian 2000-10-09 18:13:37 Re: How does TOAST compare to other databases' mechanisms?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-10-09 18:27:21 Re: [ADMIN] postgres functions(.so)
Previous Message Bruce Momjian 2000-10-09 17:40:30 Re: ALTER TABLE DROP COLUMN