Re: Get the table creation DDL - Mailing list pgsql-general

From Mladen Gogala
Subject Re: Get the table creation DDL
Date
Msg-id f4a21927-c777-0239-6417-8af47bc76141@gmail.com
Whole thread Raw
In response to Re: Get the table creation DDL  (Michael Nolan <htfoot@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Michael Nolan
Date:
Subject: Re: Get the table creation DDL
Next
From: Igor Korot
Date:
Subject: Re: Get the table creation DDL