Re: Reference to parent query from ANY sublink

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Antonin Houska <antonin(dot)houska(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reference to parent query from ANY sublink
Date: 2013-12-10 23:06:22
Message-ID: 1386716782.5203.YahooMailNeo@web162905.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Antonin Houska <antonin(dot)houska(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-12-10 23:08:58 Re: pg_stat_statements fingerprinting logic and ArrayExpr
Previous Message Jeff Janes 2013-12-10 23:03:49 Re: ANALYZE sampling is too good