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

From Holger Jakobs
Subject Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl
Date
Msg-id e26607cb-0591-e5d1-cf5b-4cefb627f91e@jakobs.com
Whole thread Raw
In response to Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl  (richard coleman <rcoleman.ascentgl@gmail.com>)
Responses Re: PostgreSQL equivalents to dbms_metadata.get_ddl & dbms_metadata.get_dependent_ddl  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-admin
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


Attachment

pgsql-admin by date:

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