Visibility of table aliases in CTEs

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Visibility of table aliases in CTEs
Date: 2013-11-16 13:05:25
Message-ID: 52876D95.4000802@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

In a WITH query, are table aliases within a CTE isolated from the rest
of the query? For example, if I do this -

with my_cte as (
select * from my_table t
)
....

- can I re-use the alias "t" elsewhere in the same query?

I had a dig through the appropriate section of the docs, but the answer
wasn't obvious to me there.

Thanks,

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jayadevan 2013-11-16 14:21:27 Re: log_line_prefix
Previous Message hubert depesz lubaczewski 2013-11-16 11:46:41 Re: log_line_prefix