| От | Karl Denninger |
|---|---|
| Тема | Re: Storing small image files |
| Дата | |
| Msg-id | 518BD1CF.3070305@denninger.net обсуждение |
| Ответ на | Re: Storing small image files (Alvaro Herrera <alvherre@2ndquadrant.com>) |
| Список | pgsql-general |
Yeah, you can go that route too.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.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера