Re: Retail DDL
От | Dilip Kumar |
---|---|
Тема | Re: Retail DDL |
Дата | |
Msg-id | CAFiTN-vob2THGz-u7AEKUfTerF+19evk9cm82GewPRZLasQBZA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Retail DDL (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Fri, Jul 25, 2025 at 9:23 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Dilip Kumar <dilipbalaut@gmail.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
В списке pgsql-hackers по дате отправления: