Use JOIN USING aliases in ruleutils.c

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Use JOIN USING aliases in ruleutils.c
Дата
Msg-id 3df848ce-f0cc-3211-2df5-abe19c11a8e9@enterprisedb.com
обсуждение исходный текст
Ответы Re: Use JOIN USING aliases in ruleutils.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
When reverse-compiling a query, ruleutils.c has some complicated code to 
handle the join output columns of a JOIN USING join.  There used to be 
no way to qualify those columns, and so if there was a naming conflict 
anywhere in the query, those output columns had to be renamed to be 
unique throughout the query.

Since PostgreSQL 14, we have a new feature that allows adding an alias 
to a JOIN USING clause.  This provides a better solution to this 
problem.  This patch changes the logic in ruleutils.c so that if naming 
conflicts with JOIN USING output columns are found in the query, these 
JOIN USING aliases with generated names are attached everywhere and the 
columns are then qualified everywhere.

The test output changes show the effects nicely.

Obviously, the copy-and-paste code in set_rtable_names() could be 
refactored a bit better, perhaps.  I also just named the generated 
aliases "ju" with numbers added, maybe there are other ideas for how to 
generate these names.
Вложения

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: [BUG]Update Toast data failure in logical replication
Следующее
От: Ashutosh Sharma
Дата:
Сообщение: Re: Synchronizing slots from primary to standby