Re: Storing many big files in database- should I do it?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing many big files in database- should I do it?
Date: 2010-04-29 18:32:19
Message-ID: j2ob42b73151004291132n923d4a5i161a6d30e57802fe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 29, 2010 at 1:51 PM, David Wall <d(dot)wall(at)computer(dot)org> wrote:
> I missed the part that BYTEA was being used since it's generally not a good
> way for starting large binary data because you are right that BYTEA requires
> escaping across the wire (client to backend) both directions, which for true
> binary data (like compressed/encrypted data, images or other non-text files)
> makes for a lot of expansion in size and related memory.

what?? postgresql supports binary data in both directions without
escaping. here is how i do it with libpqtypes:

PGbytea b;
b.data = some_pointer;
b.len = data_length;

res = PGexecf(conn, "insert into table values (%bytea*);", b);

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ozz Nixon 2010-04-29 18:45:42 Re: Performance and Clustering
Previous Message Andy Colson 2010-04-29 18:16:11 Re: Performance and Clustering