Re: DDL for database creation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Julie Nishimura <juliezain(at)hotmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: DDL for database creation
Date: 2019-03-09 03:20:12
Message-ID: 28977.1552101612@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2019-03-09 04:01:05 Re: DDL for database creation
Previous Message Bruce Momjian 2019-03-09 02:39:29 Re: DDL for database creation