From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Julie Nishimura <juliezain@hotmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: DDL for database creation
Date: Fri, 08 Mar 2019 22:20:12 -0500
Message-ID: <28977.1552101612@sss.pgh.pa.us> (raw)
In-Reply-To: <20190309023929.2ps4qotfwhj2b4hw@momjian.us>
References: <BYAPR08MB5014D04FDC8EC9FF5F6EA0B1AC4E0@BYAPR08MB5014.namprd08.prod.outlook.com>
<20190309023929.2ps4qotfwhj2b4hw@momjian.us>
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.
regards, tom lane
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: tgl@sss.pgh.pa.us, bruce@momjian.us, juliezain@hotmail.com
Subject: Re: DDL for database creation
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>
* 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