Re: Do FROM items of different schemas conflict?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Do FROM items of different schemas conflict?
Date: 2002-03-08 22:27:39
Message-ID: 200203082227.g28MRdI28853@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Okay folks, time to put on your language-lawyer hats ...
>
> I have been trying to puzzle out the SQL rules concerning whether two
> FROM items conflict in the presence of schemas. It is entirely clear
> that one is not allowed to write
>
> SELECT * FROM tab1, tab1;
>
> since this introduces two FROM items of the same name in the same scope.
> One *can* write
>
> SELECT * FROM tab1, tab1 AS x;
>
> since the alias x effectively becomes the name of the second FROM item.
> But what about
>
> SELECT * FROM schema1.tab1, schema2.tab1;

From my simplistic understanding, I would say if we allowed this, we
would have to require the schema designtation be on every reference to
tab1 in the query. Is that something we can do?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-03-08 22:34:48 Re: Do FROM items of different schemas conflict?
Previous Message Jessica Perry Hekman 2002-03-08 22:05:47 implementing query timeout