Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Dirk Heinrichs <dirk(dot)heinrichs(at)altum(dot)de>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.
Date: 2010-11-03 21:36:12
Message-ID: m2iq0eqecz.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dirk Heinrichs <dirk(dot)heinrichs(at)altum(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vlad Romascanu 2010-11-04 00:48:39 BUG #5743: Regexp engine fails to case-insensitively match multi-byte codepoints
Previous Message Dirk Heinrichs 2010-11-03 21:16:49 Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.