Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E7F5B1337B5C for ; Wed, 3 Nov 2010 18:36:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 26014-01 for ; Wed, 3 Nov 2010 21:36:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from acidenitrix.villemain.org (acidenitrix.villemain.org [91.121.90.165]) by mail.postgresql.org (Postfix) with ESMTP id 8863C1337B56 for ; Wed, 3 Nov 2010 18:36:18 -0300 (ADT) Received: from 89-158-241-48.rev.dartybox.com ([89.158.241.48] helo=DimIMac.local) by acidenitrix.villemain.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PDl0E-00087M-FV; Wed, 03 Nov 2010 22:36:18 +0100 Received: by DimIMac.local (Postfix, from userid 501) id BDCDC113245B; Wed, 3 Nov 2010 22:36:12 +0100 (CET) From: Dimitri Fontaine To: Dirk Heinrichs Cc: Dimitri Fontaine , pgsql-bugs@postgresql.org Subject: Re: BUG #5740: contrib/spi/moddatetime.c doesn't work with timezones. Organization: 2ndQuadrant References: <201011021514.oA2FE1FT054444@wwwmaster.postgresql.org> <4CD1D141.7070108@altum.de> User-Mail-Address: dimitri@2ndQuadrant.fr Date: Wed, 03 Nov 2010 22:36:12 +0100 In-Reply-To: <4CD1D141.7070108@altum.de> (Dirk Heinrichs's message of "Wed, 03 Nov 2010 22:16:49 +0100") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/26 X-Sequence-Number: 28606 Dirk Heinrichs 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