From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Karl Denninger <karl(at)denninger(dot)net> |
Cc: | Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, pgsql-general(at)postgresql(dot)org, Nelson Green <nelsongreen84(at)gmail(dot)com> |
Subject: | Re: Storing small image files |
Date: | 2013-05-09 16:34:33 |
Message-ID: | 20130509163432.GC29984@eldon.alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Karl Denninger escribió:
> > To encode:
> >
> >
> > write_conn = Postgresql communication channel in your software that is
> > open to write to the table
> >
> > char *out;
> > size_t out_length, badge_length;
> >
> > badge_length = function-to-get-length-of(badge_binary_data); /* You
> > have to know how long it is */
> >
> > out = PQescapeByteaConn(write_conn, badge_binary_data, badge_length,
> > &out_length); /* Convert */
> >
> > That function allocates the required memory for the conversion.
I think you're better off with PQexecParams() so that you don't have to
encode the image at all; just load it in memory and use it as a
parameter.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Karl Denninger | 2013-05-09 16:41:51 | Re: Storing small image files |
Previous Message | Karl Denninger | 2013-05-09 16:21:56 | Re: Storing small image files |