Search Postgresql Archives

[NOVICE] Convert Datum to an user-defined data type?

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

 



Hi everyone,
I have created a new data types using SQL in a database:

CREATE TYPE type1 AS (
score integer,
time integer[],
);

I also created a server extension module (C code), and I was able to retrieve a Datum value of type1 from the database (using SPI_ functions)
My question is: how can I convert that Datum value back to type1 data structure (in C code), so I can easily deal with score and time values?

typedef struct type1{
int score;
int *time;
} type1;

PS: I really don't want to deal with cstring to in order to get the score and time attributes.

Many thanks :)


[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