Search Postgresql Archives

Re: Storing small image files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux