pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Date: Mon, 20 Mar 2023 15:30:02 +0100
Message-ID: <e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com> (raw)
In-Reply-To: <CAGA3vBvvCf3=BLt0ehGbevjRp8O9d-X6Hi6NWKRiDcEpmvwg8w@mail.gmail.com>
References: <CAGA3vBt=an4RqygEvUeeLPB_s0W92hC2DtjFmxV2eKu93NWOKA@mail.gmail.com>
	<18e53273-264a-2ccf-e1ed-070fc6d7c381@jakobs.com>
	<CAGA3vBvvCf3=BLt0ehGbevjRp8O9d-X6Hi6NWKRiDcEpmvwg8w@mail.gmail.com>

Am 20.03.23 um 15:02 schrieb richard coleman:
> Holger,
>
> Thanks, but I was looking for a SQL callable function(s), analogous to 
> the Oracle  dbms_metadata.get_ddl() & 
> dbms_metadata.get_dependent_ddl() functions that return DDL in plain 
> text from an SQL query.
>
> It appears that PostgreSQL doesn't have that ability, at least not as 
> a built-in function and with the suggestions of others on this list 
> I'll have to write my own.
>
> Thanks again,
> rik.
>
Rik,

But you realize that on the other hand a PostgreSQL user switching to 
Oracle could say:

"It appears that Oracle lacks PostgreSQL's proprietary views showing the 
structure of the database."

Actually, nothing besides the ISO standard INFORMATION SCHEMA is in any 
way standardised. The SQL standard is not comprehensive here and leaves 
a lot to the implementor.

It's not difficult to write table-valued functions returning the DDL of 
database objects, but it's a lot of work.

Regards,

Holger


-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  [application/pgp-signature] OpenPGP_signature (202B, ../e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com/2-OpenPGP_signature)
  download

view thread (20+ messages)  latest in thread

Message-ID: <e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com>
Permalink:  ../e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com/
Also on:    postgresql.org/message-id/e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com

 · 

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: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
  In-Reply-To: <e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com>

* 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