richard coleman <rcoleman.ascentgl@xxxxxxxxx> 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