Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-24 Thread Ken Tanzer
On Sat, Nov 23, 2013 at 9:21 AM, Tom Lane t...@sss.pgh.pa.us wrote: Ken Tanzer ken.tan...@gmail.com writes: On Sat, Nov 23, 2013 at 2:20 AM, Vik Fearing vik.fear...@dalibo.com wrote: Chapter 15 of our documentation handles installing from source.

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-23 Thread Vik Fearing
On 11/23/2013 07:41 AM, Ken Tanzer wrote: OTOH, if there were a very clear and credible page with good instructions on installing build environment + postgres (for say RHEL, Ubuntu Fedora) that would install side by side with an existing installation (and how to remove it all cleanly) it

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-23 Thread Ken Tanzer
On Sat, Nov 23, 2013 at 2:20 AM, Vik Fearing vik.fear...@dalibo.com wrote: On 11/23/2013 07:41 AM, Ken Tanzer wrote: OTOH, if there were a very clear and credible page with good instructions on installing build environment + postgres (for say RHEL, Ubuntu Fedora) that would install side by

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-23 Thread Adrian Klaver
On 11/23/2013 02:45 AM, Ken Tanzer wrote: On Sat, Nov 23, 2013 at 2:20 AM, Vik Fearing vik.fear...@dalibo.com mailto:vik.fear...@dalibo.com wrote: On 11/23/2013 07:41 AM, Ken Tanzer wrote: OTOH, if there were a very clear and credible page with good instructions on installing

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-23 Thread Tom Lane
Ken Tanzer ken.tan...@gmail.com writes: On Sat, Nov 23, 2013 at 2:20 AM, Vik Fearing vik.fear...@dalibo.com wrote: Chapter 15 of our documentation handles installing from source. http://www.postgresql.org/docs/current/static/installation.html Thanks for the link. I really do appreciate all

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-22 Thread Tom Lane
I wrote: If you just need a work-around-it-right-now solution, I'd suggest introducing an OFFSET 0 optimization fence into one or another of the levels of view below the outer joins. I've not experimented but I think that ought to fix it, at some possibly-annoying cost in query optimization.

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-22 Thread Ken Tanzer
On Fri, Nov 22, 2013 at 8:04 AM, Tom Lane t...@sss.pgh.pa.us wrote: I wrote: If you just need a work-around-it-right-now solution, I'd suggest introducing an OFFSET 0 optimization fence into one or another of the levels of view below the outer joins. I've not experimented but I think

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-22 Thread Tom Lane
Ken Tanzer ken.tan...@gmail.com writes: On Fri, Nov 22, 2013 at 8:04 AM, Tom Lane t...@sss.pgh.pa.us wrote: I found a less nasty workaround: if you replace my_field by foo.my_field in the SELECT list of boo_top_view, the problem goes away. I'm happy to be of assistance, but mostly glad it

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-22 Thread Ken Tanzer
Thanks Tom. The workaround seems harmless, even good coding practice, so it's all good on my end. If it were useful to you I'd gladly build and test it, but I doubt that's the case. But just say the word! Otherwise it's just a question of time and priorities, and it seems likely to chew up at

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Kevin Grittner
Ken Tanzer ken.tan...@gmail.com wrote: In doing a left join with a particular view as the right table, and non-matching join criteria, I am getting values returned in a few fields.  All the rest are NULL.  I would expect all the right side values to be NULL. What is the output of executing?:

[GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Ken Tanzer
Hello. In doing a left join with a particular view as the right table, and non-matching join criteria, I am getting values returned in a few fields. All the rest are NULL. I would expect all the right side values to be NULL. (The view is large and messy, but it doesn't seem like that should

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Ken Tanzer
On Thu, Nov 21, 2013 at 2:22 PM, Kevin Grittner kgri...@ymail.com wrote: Ken Tanzer ken.tan...@gmail.com wrote: In doing a left join with a particular view as the right table, and non-matching join criteria, I am getting values returned in a few fields. All the rest are NULL. I would

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Tom Lane
Ken Tanzer ken.tan...@gmail.com writes: Hello. In doing a left join with a particular view as the right table, and non-matching join criteria, I am getting values returned in a few fields. All the rest are NULL. I would expect all the right side values to be NULL. Hmmm ... the join

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Ken Tanzer
On Thu, Nov 21, 2013 at 5:12 PM, Tom Lane t...@sss.pgh.pa.us wrote: Ken Tanzer ken.tan...@gmail.com writes: Hello. In doing a left join with a particular view as the right table, and non-matching join criteria, I am getting values returned in a few fields. All the rest are NULL. I

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Ken Tanzer
The issue also seems tied to the non-NULL constant in the view. This one yields rows 33::int AS b_field This one doesn't NULL::int AS b_field DROP VIEW IF EXISTS boo_top_view; DROP VIEW IF EXISTS boo_view; DROP TABLE IF EXISTS boo_table; DROP TABLE IF EXISTS a_table; CREATE TABLE

Re: [GENERAL] Getting non_NULL right-side values on a non-matching join?

2013-11-21 Thread Tom Lane
Ken Tanzer ken.tan...@gmail.com writes: Getting a build environment together seemed more painful, so here's a test case. Wow, that's pretty broken. I'll dig into it tomorrow. Just for fun, I tried this in another database on a different machine (and with 9.0.08). I got the same results, so