Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-14 Thread Tom Lane
Dean Rasheed writes: > On 13 December 2013 15:07, Tom Lane wrote: >> How about as-is in the back branches, and throw the new errors only >> in HEAD? > Seems reasonable. After further experimentation I've concluded that maybe we'd better not back-patch this change. The reason for my change of h

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-13 Thread Dean Rasheed
On 13 December 2013 15:07, Tom Lane wrote: > Dean Rasheed writes: >> I can't think of any practical uses for this kind of query, so I don't >> think it's worth worrying too much about its results until/unless >> someone comes up with a real use-case. > >> However, given that we currently support

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-13 Thread Tom Lane
Dean Rasheed writes: > I can't think of any practical uses for this kind of query, so I don't > think it's worth worrying too much about its results until/unless > someone comes up with a real use-case. > However, given that we currently support queries like "select distinct > * from nocols" (alb

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-13 Thread Dean Rasheed
On 13 December 2013 01:14, Tom Lane wrote: > The only thing I've come across that arguably doesn't work is SELECT > DISTINCT: > > regression=# select distinct from pg_database; > -- > (8 rows) > > The reason this says "8 rows" is that the produced plan is just a seqscan > of pg_database returning

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-12 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane escribió: >> What I'm thinking about this today is that really the *right* solution >> is to allow syntactically-empty SELECT lists; once we've bought into the >> notion of zero-column tables, the notion that you can't have an empty >> select list is just fundamen

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-04 Thread Alvaro Herrera
Tom Lane escribió: > What I'm thinking about this today is that really the *right* solution > is to allow syntactically-empty SELECT lists; once we've bought into the > notion of zero-column tables, the notion that you can't have an empty > select list is just fundamentally at odds with that. And

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-04 Thread Tom Lane
Dean Rasheed writes: > On 3 December 2013 23:37, Tom Lane wrote: >> Thinking some more about bug #8648, it occurred to me that ruleutils.c >> isn't exactly prepared for the case either: >> ... So I'm leaning towards just doing >> >> + if (colno == 0) >> + app

Re: [HACKERS] ruleutils vs. empty targetlists

2013-12-04 Thread Dean Rasheed
On 3 December 2013 23:37, Tom Lane wrote: > Thinking some more about bug #8648, it occurred to me that ruleutils.c > isn't exactly prepared for the case either: > > regression=# create table nocols(); > CREATE TABLE > regression=# create view vv1 as select exists (select * from nocols); > CREATE V

[HACKERS] ruleutils vs. empty targetlists

2013-12-03 Thread Tom Lane
Thinking some more about bug #8648, it occurred to me that ruleutils.c isn't exactly prepared for the case either: regression=# create table nocols(); CREATE TABLE regression=# create view vv1 as select exists (select * from nocols); CREATE VIEW regression=# \d+ vv1 View "public.