Re: Storing images as BYTEA or large objects

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Koen Vermeer <koen(at)vermeer(dot)tv>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing images as BYTEA or large objects
Date: 2008-02-13 13:45:32
Message-ID: 20080213134532.GB11314@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Koen Vermeer wrote:

> Instead of base64 encoding, I guess it would be easier to just escape
> the required bytes and store them in a bytea.

Actually, if you have access to the pqExecParams() call, you can pass
the bytes to a bytea column unescaped, which AFAIK saves some processing
on both the client and server.

To get the bytes back unescaped, I think you could use a binary cursor.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Koen Vermeer 2008-02-13 13:51:36 Re: Storing images as BYTEA or large objects
Previous Message Brad Nicholson 2008-02-13 13:40:00 Re: Perceived weaknesses of postgres