Re: understanding Datum -> char * -> Datum conversions
| От | Karel Zak |
|---|---|
| Тема | Re: understanding Datum -> char * -> Datum conversions |
| Дата | |
| Msg-id | Pine.LNX.3.96.1000525114728.31465F-100000@ara.zf.jcu.cz обсуждение исходный текст |
| Ответ на | Re: understanding Datum -> char * -> Datum conversions (Louis-David Mitterrand <cunctator@apartia.ch>) |
| Ответы |
Re: understanding Datum -> char * -> Datum conversions
|
| Список | pgsql-hackers |
>
> The problem is converting the Datum to a base C type in order to be able
> to modify it.
>
> in pgsql/contrib/spi/timetravel.c there is an example which modifies
> date columns and uses DatumGetInt32 to convert them. But this is
> confusing because (1) Tom Lane says that datetime columns are double and
> one should use DatumGetPointer (how do I use the pointer after?) and (2)
> DatumGetInt32 doesn't seem to return the number of seconds.
See in PG's backend source files:
c.h - for datetype definition and Datum macros, we have Datum macros for double/float types too.
buildin.h - for datetype conversion.utils/timestamp.h ...etc.
and directory utils/adt for inspiration "how work
with pg types :-)
I believe that you will understand.
Karel
В списке pgsql-hackers по дате отправления: