Re: Retail DDL

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Retail DDL
Date: 2025-07-25 04:06:27
Message-ID: CAFiTN-vob2THGz-u7AEKUfTerF+19evk9cm82GewPRZLasQBZA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 25, 2025 at 9:23 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Dilip Kumar <dilipbalaut(at)gmail(dot)com> writes:
> > OTOH, we can have a common function and pass object type as parameter
> > i.e. select pg_get_ddl('table', 'mytable'), with this the same
> > function can be extended for different object types.
>
> And you'll work regclass/regtype/etc into that how? AFAICS the
> only way would involve fundamentally redundant typing:
>
> select pg_get_ddl('table', 'mytable'::regclass);
>
> How is that better?

I got your point that now we need redundant typing for the objects
which already have reg* types, I think the advantage of this is we
don't need to have different functions names if we support multiple
object types like pg_get_table_ddl, pg_get_function_ddl,
pg_get_role_ddl, instead we can just do that with pg_get_ddl('table',
'mytable'); pg_get_ddl('function', 'mytable'); pg_get_ddl('role',
'myrole'); etc.

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-07-25 04:34:16 Re: Retail DDL
Previous Message Japin Li 2025-07-25 03:57:52 Re: [WIP]Vertical Clustered Index (columnar store extension) - take2