Proposition for columns expanding: table_name.**

From: Eugen Konkov <kes-kes(at)yandex(dot)ru>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Proposition for columns expanding: table_name.**
Date: 2021-05-22 08:37:54
Message-ID: 668748662.20210522113754@yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-05-22 13:18:57 Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS
Previous Message Bharath Rupireddy 2021-05-22 08:17:24 Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options