Variable-length Types

Поиск
Список
Период
Сортировка
От Itai Zukerman
Тема Variable-length Types
Дата
Msg-id 871yxi432t.fsf@matt.w80.math-hat.com
обсуждение исходный текст
Список pgsql-sql
I'm going from the documentation in the Programmer's Guide, chapter 4.

I'd like to have the following type available in Postegres:

typedef struct FullName { char *first; char *last;
} FullName;

According to the docs, it looks like I need to do something like:

typedef struct FullName { int4 len; int first; int last; char data[1];
} FullName;

where data[] stores both first and last names (has two '\0'
terminators in it), and first and last are indexes into data[]?  Is
there a better way to do this?

-itai




В списке pgsql-sql по дате отправления: