| От | Will Harrower |
|---|---|
| Тема | Re: Pointers in custom types |
| Дата | |
| Msg-id | 49A03EA5.1090805@doc.ic.ac.uk обсуждение исходный текст |
| Ответ на | Re: Pointers in custom types (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
Tom Lane wrote:
> Will Harrower <wjh105@doc.ic.ac.uk> writes:
>
>> I'm writing a custom type in C that needs to manage two byte arrays
>> (among other things). I have attempted to implement this using something
>> similar to the following struct (along with corresponding input and
>> output functions):
>>
>
>
>> typedef struct example {
>> bytea* first;
>> bytea* second;
>> } example;
>>
>
> You can't do that; the value of a datatype has to be a single chunk of
> memory, and it has to be independent of exactly where it's stored
> because it will get copied around without modification.
>
> regards, tom lane
>
Ok, that makes sense, thanks. Guess I'll stick to a bytea and an extra
index.
Cheers,
Will.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера