BUG #13833: Postgres ORDER BY value inside json causes “column does not exist” error

From: ttmigueltt(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13833: Postgres ORDER BY value inside json causes “column does not exist” error
Date: 2015-12-26 17:19:02
Message-ID: 20151226171902.2673.54859@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13833
Logged by: Michael Milton
Email address: ttmigueltt(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message los_mas_buscados1995 2015-12-27 23:48:25 BUG #13834: llenado
Previous Message Michael Paquier 2015-12-26 13:45:57 Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while