Re: Storing jpgs

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Joe Lester <joe_lester(at)sweetwater(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, "Gavin M(dot)Roy" <gmr(at)ehpg(dot)net>
Subject: Re: Storing jpgs
Date: 2004-04-06 19:11:04
Message-ID: 407300C8.5000705@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Lester wrote:
> Would anyone have some example code they could share using libpq to
> encode an image into a text field? Right now, I'm converting my image
> into a hexadecimal string representation in my SQL statement. I'm sure
> there must be a better (faster) way. The hex encodeing/decoding slows
> things down for me since my app deals with a lot of images.

Is this what you're looking for?:
http://www.postgresql.org/docs/7.4/static/libpq-exec.html#LIBPQ-EXEC-ESCAPE-BYTEA

I don't have actual numbers to support it, but I would expect that using
Postgres' escape function will be faster since it only escapes what
absolutely must be escaped.

HTH

--
Bill Moran
Potential Technologies
http://www.potentialtech.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Erickson 2004-04-06 20:07:24 Re: Creating a trigger function
Previous Message Richard Huxton 2004-04-06 19:02:12 Re: Creating a trigger function