Search Postgresql Archives

Re: Pointers in custom types

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

 



Tom Lane wrote:
Will Harrower <wjh105@xxxxxxxxxxxx> 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.

--
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