Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones. - Mailing list pgsql-bugs

From Dimitri Fontaine
Subject Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.
Date
Msg-id m2iq0eqecz.fsf@2ndQuadrant.fr
Whole thread Raw
In response to BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.  ("Dirk Heinrichs" <dirk.heinrichs@altum.de>)
Responses Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Dirk Heinrichs <dirk.heinrichs@altum.de> writes:
> Please find the patch attached. It's against 8.4.5.
>
>  extern Datum moddatetime(PG_FUNCTION_ARGS);
> +extern Datum moddatetimetz(PG_FUNCTION_ARGS);
[...]
> +CREATE OR REPLACE FUNCTION moddatetimetz()
> +RETURNS trigger
> +AS 'MODULE_PATHNAME'
> +LANGUAGE C;

You can also do AS 'MODULE_PATHNAME', 'c_function_name' and maintain a
single C function that copes with both timestamp and timestamptz
arguments, that's what I had in mind: you still declare two functions at
the SQL level, though.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

pgsql-bugs by date:

Previous
From: "Tian Shiquan"
Date:
Subject: BUG #5742: cannot alter column
Next
From: Dirk Heinrichs
Date:
Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.