Re: Feature request: pg_get_tabledef(text)

2024-03-31 Thread Hans Schou
On Wed, Nov 22, 2023 at 5:09 PM Laurenz Albe wrote: > > One of the problems is what should be included. > Indexes? Policies? Constraints? > A high limit could be all objects except data. All the objects which would be deleted by a 'DROP TABLE'. Maybe including 'CASCADE'? No unsurmountable

Re: Feature request: pg_get_tabledef(text)

2023-11-22 Thread Ron Johnson
On Wed, Nov 22, 2023 at 11:09 AM Laurenz Albe wrote: > On Wed, 2023-11-22 at 16:41 +0100, Hans Schou wrote: > > Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful > with a pg_get_tabledef() to get a full description of how a table is > defined. > > This has been requested

Re: Feature request: pg_get_tabledef(text)

2023-11-22 Thread Erik Wienhold
On 2023-11-22 16:41 +0100, Hans Schou wrote: > Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful > with a pg_get_tabledef() to get a full description of how a table is > defined. There's already a discussion on that topic[1]. But I don't know about the current state of

Re: Feature request: pg_get_tabledef(text)

2023-11-22 Thread Laurenz Albe
On Wed, 2023-11-22 at 16:41 +0100, Hans Schou wrote: > Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful with > a pg_get_tabledef() to get a full description of how a table is defined. This has been requested before:

Re: Feature request: pg_get_tabledef(text)

2023-11-22 Thread Ron Johnson
On Wed, Nov 22, 2023 at 10:41 AM Hans Schou wrote: > Hi > > Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful > with a pg_get_tabledef() to get a full description of how a table is > defined. > Because there's already pg_get_viewdef(), pg_get_functiondef(),

Feature request: pg_get_tabledef(text)

2023-11-22 Thread Hans Schou
Hi Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful with a pg_get_tabledef() to get a full description of how a table is defined. Currently the table definition can be extracted with the command: pg_dump -d foo --schema-only --table=bar | egrep '^[^-]' The psql command