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

2010-11-05 Thread Tom Lane
"Kevin Grittner" writes: > Tom Lane wrote: >> Here's a proposed patch, sans documentation as yet. > I see you took the surgical approach -- only a cast from a record to > a character string type is affected. I agree that will fix the > complaints I've seen, and I imagine you're keeping the cha

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

2010-11-05 Thread Kevin Grittner
Tom Lane wrote: > Here's a proposed patch, sans documentation as yet. I see you took the surgical approach -- only a cast from a record to a character string type is affected. I agree that will fix the complaints I've seen, and I imagine you're keeping the change narrow to minimize the risk o

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

2010-11-05 Thread Tom Lane
I wrote: > Ah. No, that would still work after the change. The case that I'm > proposing to break is using function-ish notation to invoke a cast > from a composite type to some other type whose name you use as if it > were a function. Even there, if you've created such a cast following > the us

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] [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 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 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 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 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-02 Thread Jon Nelson
On Tue, Nov 2, 2010 at 4:34 PM, Kevin Grittner wrote: > Jon Nelson wrote: > >> If I saw this behavior ( a.b also meaning b(a) ) in another SQL >> engine, I would consider it a thoroughly unintuitive wart > > I think the main reason it has been kept is the converse -- if you > define a function "b

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

2010-11-02 Thread Kevin Grittner
Jon Nelson wrote: > If I saw this behavior ( a.b also meaning b(a) ) in another SQL > engine, I would consider it a thoroughly unintuitive wart I think the main reason it has been kept is the converse -- if you define a function "b" which takes record "a" as its only parameter, you have effect

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

2010-10-31 Thread Jon Nelson
On Fri, Oct 29, 2010 at 2:07 PM, Tom Lane wrote: > [ please continue any further discussion in pgsql-bugs only ] > > "Kevin Grittner" writes: >> Tom Lane wrote: >>> BTW this seems pretty far off-topic for pgsql-performance. > >> It is once you understand what's happening.  It was probably the 11

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

2010-10-29 Thread Robert Haas
On Oct 29, 2010, at 5:53 PM, Tom Lane wrote: > Robert Haas writes: >> Yeah, I think we're going to have to live with it, at least for 8.4. One >> could make an argument that 9.0 is new enough we could get away with a small >> behavior change to avoid a large amount of user confusion. But that

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

2010-10-29 Thread Tom Lane
Robert Haas writes: > Yeah, I think we're going to have to live with it, at least for 8.4. One > could make an argument that 9.0 is new enough we could get away with a small > behavior change to avoid a large amount of user confusion. But that may be a > self-serving argument based on wanting

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

2010-10-29 Thread Robert Haas
On Oct 29, 2010, at 4:21 PM, "Kevin Grittner" wrote: > 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

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

2010-10-29 Thread Kevin Grittner
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 exact fix I'd pick, but >>> it's

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

2010-10-29 Thread Tom Lane
"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 exact fix I'd pick, but >> it's clearly better than nothing

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

2010-10-29 Thread Kevin Grittner
Robert Haas wrote: >> 2. The notation t(x) will be taken to mean x::t if there's no >> function t() taking x's type, but there is a cast from x's type >> to t. >> 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

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

2010-10-29 Thread Robert Haas
On Fri, Oct 29, 2010 at 3:07 PM, Tom Lane wrote: > [ please continue any further discussion in pgsql-bugs only ] > > "Kevin Grittner" writes: >> Tom Lane wrote: >>> BTW this seems pretty far off-topic for pgsql-performance. > >> It is once you understand what's happening.  It was probably the 11

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

2010-10-29 Thread Tom Lane
[ please continue any further discussion in pgsql-bugs only ] "Kevin Grittner" writes: > Tom Lane wrote: >> BTW this seems pretty far off-topic for pgsql-performance. > It is once you understand what's happening. It was probably the 11+ > minutes for the mistyped query run, versus the 28 ms w