Cannot query views with WHERE clause on renamed columns

From: Alexander Reichstadt <lxr(at)mac(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Cannot query views with WHERE clause on renamed columns
Date: 2014-06-30 21:41:30
Message-ID: F75F66D7-F5E0-4F5D-90CE-E5DCCE4771B3@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I try to do what seems to be totally simple, but it fails. If I query a view that contains renamed columns without any qualifier like

SELECT * FROM myview

it displays everything. If however I do

SELECT reanmedviewcolumn FROM myview

It tells me column does not exist which in fact does. I can query any non-renamed columns. But the renamed ones I can neither call by their original name, not int he SELECT part nor in the WHERE clause.

I can neither leave the view with just the original names as it's a selfjoin.

What do I need to do?

Thanks
Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2014-06-30 22:36:48 lock contention, need profiling idea
Previous Message Jerry Sievers 2014-06-30 21:37:03 Re: how to create a role with no privileges?