Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aDYz1-0008Hz-8a for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Dec 2015 14:41:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aDYz0-0006hf-Rh for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Dec 2015 14:41:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aCsVj-00081Y-Pz for pgsql-bugs@postgresql.org; Sat, 26 Dec 2015 17:20:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aCsVf-0000u4-Lv for pgsql-bugs@postgresql.org; Sat, 26 Dec 2015 17:20:06 +0000 MIME-Version: 1.0 Subject: =?utf-8?q?BUG_=2313833=3A_Postgres_ORDER_BY_value_inside_json_caus?= =?utf-8?q?es_=E2=80=9Ccolumn_does_not_exist=E2=80=9D_error?= To: pgsql-bugs@postgresql.org From: ttmigueltt@gmail.com Date: Sat, 26 Dec 2015 17:19:02 +0000 Message-ID: <20151226171902.2673.54859@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13833 Logged by: Michael Milton Email address: ttmigueltt@gmail.com PostgreSQL version: 9.4.4 Operating system: Fedora 22 Description: It's probably easiest to link to the StackOverflow question I posted: http://stackoverflow.com/questions/34472961/postgres-order-by-value-inside-json-causes-column-does-not-exist-error The summary of it is that this query throws the error "column sets does not exist", despite the fact that it is created in the SELECT clause: SELECT coalesce(block.name, 'Other') as name, json_agg(set.data) as sets FROM set FULL OUTER JOIN block ON set.block_id = block.id GROUP BY block.id ORDER BY sets -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs