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] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Merlin Moncure
On Fri, Oct 29, 2010 at 4:12 PM, Tom Lane wrote: > "Kevin Grittner" writes: >> Robert Haas wrote: I think if I had to pick a proposal, I'd say we should disable #2 for the specific case of casting a composite type to something else. > >>> Well, then let's do that.  It's not the ex

Re: [BUGS] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Kevin Grittner
Merlin Moncure wrote: > Trying to understand real world cases that this would > break...would the following now fail w/o explicit cast? > > create type x as (a int, b int); > select f((1,2)); It already does: test=# create type x as (a int, b int); CREATE TYPE test=# select f((1,2)); ERROR:

Re: [BUGS] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Tom Lane
"Kevin Grittner" writes: > Merlin Moncure wrote: >> Trying to understand real world cases that this would >> break...would the following now fail w/o explicit cast? >> >> create type x as (a int, b int); >> select f((1,2)); > It already does: I think Merlin probably meant to write "select x((

Re: [BUGS] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Merlin Moncure
On Thu, Nov 4, 2010 at 12:14 PM, Tom Lane wrote: > "Kevin Grittner" writes: >> Merlin Moncure wrote: >>> Trying to understand real world cases that this would >>> break...would the following now fail w/o explicit cast? >>> >>> create type x as (a int, b int); >>> select f((1,2)); > >> It already

Re: [BUGS] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Kevin Grittner
Tom Lane wrote: > What would be affected is something like > > select text((1,2)); > > which you'd now be forced to write as > > select (1,2)::text; > > (or you could use CAST notation; but not text(row) or row.text). Right. As far as I'm aware, there are currently four ways t

Re: [BUGS] [PERFORM] typoed column name, but postgres didn't grump

2010-11-04 Thread Tom Lane
Merlin Moncure writes: > On Thu, Nov 4, 2010 at 12:14 PM, Tom Lane wrote: >> "Kevin Grittner" writes: >>> Merlin Moncure wrote: create type x as (a int, b int); select f((1,2)); >> I think Merlin probably meant to write "select x((1,2))", but that >> doesn't work out-of-the-box eithe

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 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