Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl - Mailing list pgsql-admin

From Tom Lane
Subject Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Date
Msg-id 803987.1679264801@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl  (richard coleman <rcoleman.ascentgl@gmail.com>)
List pgsql-admin
richard coleman <rcoleman.ascentgl@gmail.com> writes:
> I am trying to find a simple way to get access the DDL information for
> PostgreSQL tables, constraints, and indices via SQL.

There are bits of that, but it's not terribly complete or consistent
because nobody's made a concerted effort to build stuff that wasn't
driven by "what does pg_dump need".  (And what pg_dump needs, for
the most part, is not simply "give me all the DDL for this object
in a black box".)

I'd suggest taking a look at the pg_get_* functions, which are
mostly documented at

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

There are some other things on that page that might help, too.

            regards, tom lane



pgsql-admin by date:

Previous
From: richard coleman
Date:
Subject: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Next
From: MichaelDBA
Date:
Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl