pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Dirk Heinrichs <dirk.heinrichs@altum.de>
Cc: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.
Date: Wed, 03 Nov 2010 22:36:12 +0100
Message-ID: <m2iq0eqecz.fsf@2ndQuadrant.fr> (raw)
In-Reply-To: <4CD1D141.7070108@altum.de>
References: <201011021514.oA2FE1FT054444@wwwmaster.postgresql.org>
	<m2wrovz8bi.fsf@2ndQuadrant.fr>
	<4CD1D141.7070108@altum.de>

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



view thread (8+ messages)  latest in thread

Message-ID: <m2iq0eqecz.fsf@2ndQuadrant.fr>
Permalink:  ../m2iq0eqecz.fsf@2ndQuadrant.fr/
Also on:    postgresql.org/message-id/m2iq0eqecz.fsf@2ndQuadrant.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: dimitri@2ndQuadrant.fr, dirk.heinrichs@altum.de
  Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones.
  In-Reply-To: <m2iq0eqecz.fsf@2ndQuadrant.fr>
  References: <201011021514.oA2FE1FT054444@wwwmaster.postgresql.org> <m2wrovz8bi.fsf@2ndQuadrant.fr> <4CD1D141.7070108@altum.de> <m2iq0eqecz.fsf@2ndQuadrant.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox