| От | gar8@pitt.edu (Tony Reina) |
|---|---|
| Тема | How can I pass an array from PostgreSQL to C (libpq)? |
| Дата | |
| Msg-id | a1688e61.0303261024.38b1b31e@posting.google.com обсуждение исходный текст |
| Ответы |
Re: How can I pass an array from PostgreSQL to C (libpq)?
|
| Список | pgsql-sql |
I'm using the C library (lipq) to grab data from a field that contains a float array (float4[]). I'd like to fill an array in my C program with these values. Unfortunately, Postgres returns the array as a large string instead of individual values. Now I could perform "select array_var[1], array_var[2], array_var[3], ..., array_var[4]" and have each array value come back as a different field, but this seems fairly messy. I suppose I could also go through and parse the characters in the string returned. Has anyone else used any other strategies to fill their C array with an array returned from the libpq? Perhaps there are some SQL functions for arrays that might exist? Thanks. -Tony
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера