Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecN2L-0003M4-JS for pgsql-general@arkaria.postgresql.org; Fri, 19 Jan 2018 03:08:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecN2K-0002oi-Uv for pgsql-general@arkaria.postgresql.org; Fri, 19 Jan 2018 03:08:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecHNM-0005Qb-P2 for pgsql-general@lists.postgresql.org; Thu, 18 Jan 2018 21:05:33 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ecHNJ-0005X8-8y for pgsql-general@postgresql.org; Thu, 18 Jan 2018 21:05:31 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 7D54120D9C for ; Thu, 18 Jan 2018 16:05:26 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute2.internal (MEProxy); Thu, 18 Jan 2018 16:05:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=cbEBdO5dpQaewqTKP/j6YaIzB2Gkt F9ZI/ChapJolcg=; b=c5DcL3iLlSz+5QkyAASB5tL48EhrJMfE18gPrcWJaUqUZ KExUYRl0jcHX3NuMi4LeJjOgWuT6kt4Uv4fgFSmDO/yE7YUUDMFmyeHQJAm0wxOf fRfjX4Hs0YlamEEayAGfUURZae+cXHK1GJ+l1X85IGDg5EwLLxZdZE5fLR4U2HaW NtFBPMGbcn1V0Ggpy7ki1RlArU376L4cgmW8oC5Dou6Y78mCjHmQmdU+IJ5smzCy 1ZjegSn4hsHlEyTN9qcV9QXzDHvhIseMd/YD3szlVHjcDAuwsE47VGJId3NRH4n1 dz3ElN628WQyW6xnn0jRkgy5NbRlfM3inr7c4mLqw== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 4E0709E3C7; Thu, 18 Jan 2018 16:05:26 -0500 (EST) Message-Id: <1516309526.4088210.1240289384.0CDAD7E3@webmail.messagingengine.com> From: Seamus Abshere To: pgsql-general@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-75de3051 Subject: warning for subquery that references a table but not its columns Date: Thu, 18 Jan 2018 18:05:26 -0300 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I almost got bit by this today: => select email from subscribed where email not in (select email from tracks); email ------- (0 rows) => select email from subscribed where email not in (select tracks.email from tracks); ERROR: column tracks.email does not exist LINE 1: ... email from subscribed where email not in (select tracks.ema... (the "tracks" table doesn't have an "email" column, so the first query is just meaningless) Should there be a warning for the first query that you reference "tracks" in a subquery but don't use any columns from it? -- Seamus Abshere, SCEA https://www.faraday.io https://github.com/seamusabshere https://linkedin.com/in/seamusabshere