Re: Do FROM items of different schemas conflict? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Do FROM items of different schemas conflict?
Date
Msg-id 200203082227.g28MRdI28853@candle.pha.pa.us
Whole thread Raw
In response to Do FROM items of different schemas conflict?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Do FROM items of different schemas conflict?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Do FROM items of different schemas conflict?
Next
From: alex@AvengerGear.com (Debian User)
Date:
Subject: Re: Object ID reference