Re: Foreign key joins revisited

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Foreign key joins revisited
Дата
Msg-id 83c451e0-8b78-dcd3-fda7-0e33e8090339@postgresfriends.org
обсуждение исходный текст
Ответ на Re: Foreign key joins revisited  ("Joel Jacobson" <joel@compiler.org>)
Ответы Re: Foreign key joins revisited  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Foreign key joins revisited  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On 12/28/21 8:26 PM, Joel Jacobson wrote:
> On Mon, Dec 27, 2021, at 19:15, Tom Lane wrote:
>> NATURAL JOIN is widely regarded as a foot-gun that the SQL committee
>> should never have invented.  Why would we want to create another one?
>>
>> (I suspect that making the constraint name optional would be problematic
>> for reasons of syntax ambiguity, anyway.)
> 
> I agree. I remember this blog post from 2013 discussing the problems
> with both NATURAL but also the problems with USING:
> http://www.databasesoup.com/2013/08/fancy-sql-monday-on-vs-natural-join-vs.html
> 
> Since my last email in this thread, I've learned KEY is unfortunately not a reserved keyword.
> This probably means the proposed "JOIN KEY" would be problematic, since a relation could be named KEY.
> 
> Can with think of some other suitable reserved keyword?

I don't particularly like this whole idea anyway, but if we're going to
have it, I would suggest

    JOIN ... USING KEY ...

since USING currently requires a parenthesized list, that shouldn't
create any ambiguity.

> How about JOIN WITH?

WITH is severely overloaded already.
-- 
Vik Fearing



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key joins revisited
Следующее
От: Adam Brusselback
Дата:
Сообщение: Re: Foreign key joins revisited