Forward referencing of table aliases in subqueries does not work in 9.1 beta2 ( works in 9.0 and 8.4.2 )

From: BangarRaju Vadapalli <BangarRaju(dot)Vadapalli(at)infor(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Forward referencing of table aliases in subqueries does not work in 9.1 beta2 ( works in 9.0 and 8.4.2 )
Date: 2011-06-20 04:33:50
Message-ID: 3DF304319BFE284182A530654E0263831CB280D81B@INHYWEXMB2.infor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Everybody,

We have a view defined like below.

CREATE OR REPLACE VIEW dim_agg_instr_actuals_view AS SELECT dbai.dim_base_agg_instr_key AS instr_key, dba.dim_base_key AS basekey, dl.datamart_letter, dba.agg_number AS aggnum, dl.enabled, dba.dim_base_agg_key, dbai.dim_base_name, dbai.dim_base_agg_name, dl.dim_base_agg_letter_key, dl.agg_size

FROM dim_base_agg_instr_view dbai, dim_base_agg dba, dim_base_agg_letter dl

WHERE dba.dim_base_agg_key = dl.dim_base_agg_key AND dbai.dim_base_key = dba.dim_base_key AND NOT (EXISTS ( SELECT 1

FROM dim_base_agg_instr_def dbaid

WHERE dbai.dim_base_agg_instr_key = dbaid.dim_base_agg_instr_key AND NOT (EXISTS ( SELECT 1

FROM dim_base_agg_col dbac

WHERE dba.dim_base_agg_key = dbac.dim_base_agg_key AND dbac.dim_col_key = dbaid.dim_col_key)))) AND NOT (EXISTS ( SELECT 1

FROM dim_base_agg_col dbac

WHERE dba.dim_base_agg_key = dbac.dim_base_agg_key AND NOT (EXISTS ( SELECT 1

FROM dim_base_agg_instr_def dbaid

WHERE dbai.dim_base_agg_instr_key = dbaid.dim_base_agg_instr_key AND dbac.dim_col_key = dbaid.dim_col_key))));

ALTER TABLE dim_agg_instr_actuals_view OWNER TO postgres;

The select query for creating the view is executing fine in 8.4.2. But not in 9.1 beta2. The issue is forward referencing of table aliases in subqueries is not working fine in 9.1 beta2.For example dbai alias in the query below...

SELECT 1

FROM dim_base_agg_instr_def dbaid

WHERE dbai.dim_base_agg_instr_key = dbaid.dim_base_agg_instr_key

Any reason why this functionality is disabled in 9.1 beta 2 ?

Thanks,

Bangar Raju

Responses

Browse pgsql-general by date

  From Date Subject
Next Message BangarRaju Vadapalli 2011-06-20 04:38:40 Re: random backend crashes - how to debug ( Is crash dump handler released ? )
Previous Message Amitabh Kant 2011-06-20 02:08:40 Re: PostgreSQL 8.4.8 bringing my website down every evening