pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: richard coleman <rcoleman.ascentgl@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Date: Mon, 20 Mar 2023 11:10:08 -0400
Message-ID: <938034.1679325008@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGA3vBv-BkLgTyf-DRW9DYjnF2=BMuKOpT0Gp7cCD1oWDvSxqw@mail.gmail.com>
References: <CAGA3vBtNLpGdPG=4gdzvD9zoTSz+52JUkfYCsNSi+mv5Yr+GVw@mail.gmail.com>
	<A6F7CC72-F6AC-49B6-8DEC-19787D18D7F5@gmail.com>
	<CAGA3vBsD_xiwuXWua6bceGToc9ZX1fmOfiaDXkw29zfqLhQ=Uw@mail.gmail.com>
	<ac9c17a9-016a-e84b-1ef3-14ce4380f05d@sqlexec.com>
	<CAGA3vBv-BkLgTyf-DRW9DYjnF2=BMuKOpT0Gp7cCD1oWDvSxqw@mail.gmail.com>

richard coleman <rcoleman.ascentgl@gmail.com> writes:
> Look below for the difference in the two functions, how they are used, the
> amount of knowledge you need to posses in order to run them and the
> difference in the output.

I'm not finding this terribly convincing, because I don't exactly see
what is the use-case for having that DDL in isolation.  Or in other
words, what is your use-case that you find pg_dump so unsatisfactory
for?  It knows all this stuff, and it also knows things like which
other objects a given object depends on and how to cope with circular
dependencies.  Most of the reasons that I can think of for wanting
the pg_get_*def functions that we don't already have seem to reduce
to building partially-baked versions of pg_dump.

If your concern is that you can't get pg_dump to slice up the schema
in exactly the way you want, adding some more options to it might be
an easier sell than implementing/maintaining a bunch of duplicate
functionality.  We just got done adding [1], for example.

			regards, tom lane

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a563c24c9574b74f4883c004c89275bba...





view thread (20+ messages)  latest in thread

Message-ID: <938034.1679325008@sss.pgh.pa.us>
Permalink:  ../938034.1679325008@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/938034.1679325008@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rcoleman.ascentgl@gmail.com
  Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
  In-Reply-To: <938034.1679325008@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox