Skip site navigation (1) Skip section navigation (2)

understanding Datum -> char * -> Datum conversions

From: Louis-David Mitterrand <cunctator(at)apartia(dot)ch>
To: pgsql-hackers(at)postgresql(dot)org
Subject: understanding Datum -> char * -> Datum conversions
Date: 2000-05-24 16:26:41
Message-ID: 20000524182641.A6621@styx (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

I am learning to programm triggers in C by using the examples and the
programmer's manual but it's a steep learning curve for a mere perl
programmer ;-)

What I am trying to do for instance is:
- read a ::text colum with SPI_getbinval(),
- convert it to a char*,
- modify it,
- convert it back to a Datum,
- reinsert it into the tuple through SPI_modifytuple,

The conversions involve some pointer magic and casting that I really
don't grasp.

Also I am trying to read a timestamp with SPI_getbinval and get the
number of seconds contained. Using DatumGetInt32 doens't seem to do it.

Thanks in advance for your insight, cheers,

Louis-David Mitterrand - ldm(at)apartia(dot)org -

Radioactive cats have 18 half-lives.


pgsql-hackers by date

Next:From: Karel ZakDate: 2000-05-24 16:34:48
Subject: Re: understanding Datum -> char * -> Datum conversions
Previous:From: Benjamin AdidaDate: 2000-05-24 16:20:25
Subject: Re: [HACKERS] Re: interactive pgsql book

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group