Proposition for columns expanding: table_name.**

Поиск
Список
Период
Сортировка
От Eugen Konkov
Тема Proposition for columns expanding: table_name.**
Дата
Msg-id 668748662.20210522113754@yandex.ru
обсуждение исходный текст
Список pgsql-hackers
Hello

I some time ago asks about "Proposition for autoname columns"
https://www.postgresql.org/message-id/131355559.20201102170529%40yandex.ru


Now I have another idea. How about table_name.**?

which will be expanded to: table_name.id, table_name.name, table_name.qty etc.


In my original query I can not just write:
SELECT
  acc_i.*,
  acc_u.*
FROM "order_bt" o
LEFT JOIN acc_ready( 'Invoice',  app_period(), o ) acc_i  ON acc_i.ready
LEFT JOIN acc_ready( 'Usage',   app_period(), o ) acc_u ON acc_u.ready

because  I  can not then refer columns from different tables, they are same =(

So I need to write:
SELECT
   acc_i.ready                       as acc_i_ready,
   acc_i.acc_period              as acc_i_period,
   acc_i.consumed_period   as acc_i_consumed_period,
   acc_u.ready                       as acc_u_ready,
   acc_u.acc_period              as acc_u_period,
   acc_u.consumed_period   as acc_u_consumed_period,
FROM "order_bt" o
LEFT JOIN acc_ready( 'Invoice',  app_period(), o ) acc_i  ON acc_i.ready
LEFT JOIN acc_ready( 'Usage',   app_period(), o ) acc_u ON acc_u.ready


It would be cool if I can just write:

SELECT
  acc_i.**,
  acc_u.**
FROM "order_bt" o
LEFT JOIN acc_ready( 'Invoice',  app_period(), o ) acc_i  ON acc_i.ready
LEFT JOIN acc_ready( 'Usage',   app_period(), o ) acc_u ON acc_u.ready


What you can say about this proposition?
-- 
Best regards,
Eugen Konkov




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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS