Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2SX7-0006rl-BR for pgsql-general@arkaria.postgresql.org; Sat, 09 Mar 2019 03:20:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h2SX6-0003Gc-4l for pgsql-general@arkaria.postgresql.org; Sat, 09 Mar 2019 03:20:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2SX5-0003GV-PQ for pgsql-general@lists.postgresql.org; Sat, 09 Mar 2019 03:20:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2SX3-0004tL-GI for pgsql-general@postgresql.org; Sat, 09 Mar 2019 03:20:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x293KCPq028978; Fri, 8 Mar 2019 22:20:12 -0500 From: Tom Lane To: Bruce Momjian cc: Julie Nishimura , "pgsql-general@postgresql.org" Subject: Re: DDL for database creation In-reply-to: <20190309023929.2ps4qotfwhj2b4hw@momjian.us> References: <20190309023929.2ps4qotfwhj2b4hw@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 08 Mar 2019 21:39:29 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28976.1552101612.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 08 Mar 2019 22:20:12 -0500 Message-ID: <28977.1552101612@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian 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? F= or >> example, I need to create dev environment for some (not all) of our exi= sting >> 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