Re: Foreign key joins revisited

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: Foreign key joins revisited
Дата
Msg-id f20c526d-6fad-4c59-9d53-f601ca5765c1@www.fastmail.com
обсуждение исходный текст
Ответ на Re: Foreign key joins revisited  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Dec 29, 2021, at 16:28, Tom Lane wrote:
>Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>> In the 1990s, there were some SQL drafts that included syntax like
>> JOIN ... USING PRIMARY KEY | USING FOREIGN KEY | USING CONSTRAINT ...
>> AFAICT, these ideas just faded away because of other priorities, so if 
>> someone wants to revive it, some work already exists.
>
> Interesting!  One thing that bothered me about this whole line of
> discussion is that we could get blindsided in future by the SQL
> committee standardizing the same idea with slightly different
> syntax/semantics.  I think borrowing this draft text would greatly
> improve the odds of that not happening.  Do you have access to
> full details?

I read an interesting comment where someone claimed the SQL standard would never
allow using constraint names in a DQL statements. [1]

I responded there already good examples of this in some vendors,
such as PostgreSQL's INSERT INTO ... ON CONFLICT.
(Thanks Alvaro, your reply previously in this thread reminded me of this case.)

I later learned the DQL sublanguage apparently doesn't include INSERT,
but nonetheless I still think it's a good example on the potential value
of using constraint names in queries.

Does anyone know if there is any such general clause in the SQL standard,
that would forbid using constraint names in SELECT queries?

/Joel

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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Probable memory leak with ECPG and AIX
Следующее
От: "Joel Jacobson"
Дата:
Сообщение: Updatable Views and INSERT INTO ... ON CONFLICT