Re: Get the table creation DDL

From: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Get the table creation DDL
Date: 2022-07-10 18:50:27
Message-ID: f4a21927-c777-0239-6417-8af47bc76141@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/10/22 13:57, Michael Nolan wrote:
> I do not know those other tools, but there should be documentation for
> them, as there is in the man page for how to process just one table
> using pg_dump.   You can pipe the output of pg_dump directly to psql,
> but I find that's seldom useful.
> --
> Mike Nolan

There is an extension which does precisely what you need:

https://github.com/MichaelDBA/pg_get_tabledef

In my opinion, that is a little inconsistency on the part of the
maintainers part because there are functions pg_get_functiondef,
pg_get_indexdef and pg_get_viewdef  but nothing for tables.

https://www.postgresql.org/docs/14/functions-info.html

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2022-07-10 18:59:40 Re: Get the table creation DDL
Previous Message Michael Nolan 2022-07-10 17:57:30 Re: Get the table creation DDL