Re: Inserting data a UDT in binary format using LIBPQ
В списке pgsql-interfaces по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Inserting data a UDT in binary format using LIBPQ |
| Дата | |
| Msg-id | 10467.1168377440@sss.pgh.pa.us обсуждение |
| Ответ на | Inserting data a UDT in binary format using LIBPQ ("Brijesh Shrivastav" <Bshrivastav@esri.com>) |
| Список | pgsql-interfaces |
"Brijesh Shrivastav" <Bshrivastav@esri.com> writes:
> Datum func_Recv(PG_FUNCTION_ARGS)
> {
> FUNC_BINARY_FORMAT *input
> = (FUNC_BINARY_FORMAT *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
Why would you expect that the input to a receive function would be
already in the datatype's internal format?
I'm too lazy to go check the code right now, but my recollection is that
what you get is a reference to a StringInfo holding the data message
received from the client. You should probably not touch the StringInfo
directly if you can avoid it, but use the convenience functions that are
provided for receive functions to use. Look at the code for existing
receive functions for datatypes similar to yours.
regards, tom lane
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера