Re: Reference to parent query from ANY sublink - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Reference to parent query from ANY sublink
Date
Msg-id 1386716782.5203.YahooMailNeo@web162905.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: Reference to parent query from ANY sublink  (Antonin Houska <antonin.houska@gmail.com>)
Responses Re: Reference to parent query from ANY sublink
List pgsql-hackers
Antonin Houska <antonin.houska@gmail.com> wrote:

> I used the DDLs attached (tables.ddl) for this query too, not
> only for the queries in quaries.sql. Yes, if I had mentioned it
> and/or qualified the 'k' column reference, it wouldn't have
> broken anything.

Apologies; I missed the attachments.  It makes a lot more sense now
that I see those.

I see this was a patch originally posted on 2013-10-31 and not
added to the CommitFest.

I applied it to master and ran the regression tests, and one of the
subselect tests failed.

This query:

SELECT '' AS six, f1 AS "Correlated Field", f3 AS "Second Field"
  FROM SUBSELECT_TBL upper
  WHERE f1 IN
    (SELECT f2 FROM SUBSELECT_TBL WHERE CAST(upper.f2 AS float) = f3);

Should have this for a result set:

 six | Correlated Field | Second Field
-----+------------------+--------------
     |                2 |            4
     |                3 |            5
     |                1 |            1
     |                2 |            2
     |                3 |            3
(5 rows)

But during the `make check` or `make install-check` it is missing
the last two rows.  Oddly, if I go into the database later and try
it, the rows show up.  It's not immediately apparent to me what's
wrong.

Will look again later, or maybe someone more familiar with the
planner can spot the problem.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: ANALYZE sampling is too good
Next
From: Tom Lane
Date:
Subject: Re: pg_stat_statements fingerprinting logic and ArrayExpr