pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: DDL for database creation
Date: Fri, 8 Mar 2019 22:01:05 -0600
Message-ID: <7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.com> (raw)
In-Reply-To: <28977.1552101612@sss.pgh.pa.us>
References: <BYAPR08MB5014D04FDC8EC9FF5F6EA0B1AC4E0@BYAPR08MB5014.namprd08.prod.outlook.com>
	<20190309023929.2ps4qotfwhj2b4hw@momjian.us>
	<28977.1552101612@sss.pgh.pa.us>

On 3/8/19 9:20 PM, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
>> On Sat, Mar  9, 2019 at 02:13:57AM +0000, Julie Nishimura wrote:
>>> Is there a way to reconstruct DDL for creation of existing databases? For
>>> example, I need to create dev environment for some (not all) of our existing
>>> databases, and I would like to keep the same encoding, connection limit (if
>>> anything was specified), etc. Is there a way to create this DDL?
>> pg_dump --schema-only maybe?
> The specific settings the OP mentions are database-level settings;
> so she'd need pg_dumpall (perhaps with -g), or pg_dump with -C.

Why not "pg_dumpall --schema-only" in combination with "pg_dumpall -g"?

https://www.postgresql.org/docs/9.6/app-pg-dumpall.html
-s
--schema-only
     Dump only the object definitions (schema), not data.


-- 
Angular momentum makes the world go 'round.




view thread (4+ messages)

Message-ID: <7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.com>
Permalink:  ../7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.com/
Also on:    postgresql.org/message-id/7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: DDL for database creation
  In-Reply-To: <7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.com>
  References: <BYAPR08MB5014D04FDC8EC9FF5F6EA0B1AC4E0@BYAPR08MB5014.namprd08.prod.outlook.com> <20190309023929.2ps4qotfwhj2b4hw@momjian.us> <28977.1552101612@sss.pgh.pa.us> <7b2aee26-5cd4-ea9b-0862-3f2bdf9029f7@gmail.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