Re: SHOW CREATE - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: SHOW CREATE
Date
Msg-id CADkLM=dNH5eL8AC6yDOUTehOhNbpu9GY75=OFAc0-C18ThCv1g@mail.gmail.com
Whole thread Raw
In response to SHOW CREATE  (David Fetter <david@fetter.org>)
Responses Re: SHOW CREATE  (Michael Glaesemann <grzm@seespotcode.net>)
Re: SHOW CREATE  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Jul 5, 2019 at 12:32 PM David Fetter <david@fetter.org> wrote:
Folks,

Corey Huinker put together the documentation for this proposed
feature. Does this seem like a reasonable way to do it?


In doing that work, it became clear that the command was serving two masters:
1. A desire to see the underlying nuts and bolts of a given database object.
2. A desire to essentially make the schema portion of pg_dump a server side command.

To that end, I see splitting this into two commands, SHOW CREATE and SHOW DUMP.

SHOW DUMP would the original command minus the object type and object name specifier, and it would dump the entire current database as seen from the current user (again, no data).

SHOW CREATE would still have all the object_type parameters as before, but would only dump the one specified object, plus any dependent objects specified in the WITH options (comments, grants, indexes, constraints, partitions, all).

Please note that any talk of a server side DESCRIBE is separate from this. That would be a series of commands that would have result sets tailored to the object type, and each one would be an inherent compromise between completeness and readability.

I'd like to hear what others have to say, and incorporate that feedback into a follow up proposal.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix runtime errors from -fsanitize=undefined
Next
From: Paul A Jungwirth
Date:
Subject: Re: range_agg