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

2010-11-04 Thread Tom Lane
Dirk Heinrichs writes: > Am 04.11.2010 04:55, schrieb Tom Lane: >> I don't actually see any point in having two functions at all. Since >> the trigger is examining the column type internally, it could perfectly >> well do the right thing at runtime depending on column type. > Got the point. Here

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

2010-11-04 Thread Dirk Heinrichs
Am 04.11.2010 04:55, schrieb Tom Lane: > I don't actually see any point in having two functions at all. Since > the trigger is examining the column type internally, it could perfectly > well do the right thing at runtime depending on column type. Got the point. Here's another patch, hope my limi

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

2010-11-04 Thread Dimitri Fontaine
Tom Lane writes: > I don't actually see any point in having two functions at all. Since > the trigger is examining the column type internally, it could perfectly > well do the right thing at runtime depending on column type. Sorry, brain fart from me. Didn't realise we're talking about a trigger

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

2010-11-03 Thread Tom Lane
Dimitri Fontaine writes: > 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_P

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

2010-11-03 Thread Dirk Heinrichs
Am 02.11.2010 23:09, schrieb Dimitri Fontaine: > So I guess that you need to modify very little code to get the trigger > to work for both types. Please find the patch attached. It's against 8.4.5. Bye... Dirk diff -u spi.old/moddatetime.c spi/moddatetime.c --- spi.old/moddatetime.c 201

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

2010-11-03 Thread Dimitri Fontaine
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

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

2010-11-02 Thread Dimitri Fontaine
"Dirk Heinrichs" writes: > The moddatetime function provided by this module only works on columns of > type "timestamp without time zone". Would be nice if it could also provide > an analogous function moddatetime_tz which provides the same functionality > for columns of type "timestamp with time

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

2010-11-02 Thread Dirk Heinrichs
The following bug has been logged online: Bug reference: 5740 Logged by: Dirk Heinrichs Email address: dirk.heinri...@altum.de PostgreSQL version: 8.4.5 Operating system: Linux Description:contrib/spi/moddatetime.c doesn't work with timezones. Details: The moddateti