Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl

From: "Edward J(dot) Sabol" <edwardjsabol(at)gmail(dot)com>
To: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Date: 2023-03-20 06:33:01
Message-ID: A6F7CC72-F6AC-49B6-8DEC-19787D18D7F5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mar 19, 2023, at 10:49 PM, richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com> wrote:


I wonder how difficult it would have been to create SQL functions out of what is basically psql or pg_dump magic.

If you ignore the answers on StackOverflow that say to use pg_dump and "psql -E", there must be close to 10 other answers with various SQL functions which do exactly that here:


















How to generate the "create table" sql statement for an existing table in postgreSQL


stackoverflow.com










I recommend you read through them and test them to find the best version. I hope one of them fits your needs. If so, I hope you report back here with which one you went with. :-)

Hoping this helps,

Ed

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2023-03-20 07:31:19 Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Previous Message richard coleman 2023-03-20 02:49:33 Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl