Re: [HACKERS] ERROR: "failed to locate grouping columns"

2009-03-08 Thread Tom Lane
OK, I poked into this. The test case can be simplified to this: regression=# create table t1 (f1 numeric(14,0), f2 varchar(30)); CREATE TABLE regression=# create view vv as select distinct f1,f2,(select f2 from t1 x where x.f1=aa.f1) as fs from t1 aa; CREATE VIEW regression=# select * from

Re: [HACKERS] ERROR: "failed to locate grouping columns"

2009-03-08 Thread Tom Lane
"Dickson S. Guedes" writes: > Em Sáb, 2009-03-07 às 19:38 -0500, Tom Lane escreveu: >> Would you put together a complete example, instead of leaving us to >> guess what's underlying the view? And what PG version is this? > Attached there is a dump with the tables and views related: > vw_that_w

Re: [HACKERS] ERROR: "failed to locate grouping columns"

2009-03-08 Thread Dickson S. Guedes
Em Sáb, 2009-03-07 às 19:38 -0500, Tom Lane escreveu: > I really have a hard time believing that whether you get that error is > contingent on whether the view returns some rows or not. That's a > planner message and couldn't possibly have to do with what happens > at runtime. Well, today I have

Re: [HACKERS] ERROR: "failed to locate grouping columns"

2009-03-07 Thread Dickson S. Guedes
Em Sáb, 2009-03-07 às 19:38 -0500, Tom Lane escreveu: > "Dickson S. Guedes" writes: > > And bellow is the select that returns: "ERROR: failed to locate grouping > > columns" > > when no rows is returned by the View above, but it runs well when one or > > more > > rows is returned by same view. >

Re: [HACKERS] ERROR: "failed to locate grouping columns"

2009-03-07 Thread Tom Lane
"Dickson S. Guedes" writes: > And bellow is the select that returns: "ERROR: failed to locate grouping > columns" > when no rows is returned by the View above, but it runs well when one or more > rows is returned by same view. I really have a hard time believing that whether you get that error i

[HACKERS] ERROR: "failed to locate grouping columns"

2009-03-07 Thread Dickson S. Guedes
Hi all, I'm sending this to -hackers because i don't now if it is a bug or a expected behavior. I have the view bellow (if the selects bellow shows unformated in this email, i put this in http://guedesoft.net/txt/vw_error.txt too. ): CREATE OR REPLACE VIEW vw_my_test AS SELECT DISTINCT