Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koVYa-0000jb-7w for pgsql-general@arkaria.postgresql.org; Sun, 13 Dec 2020 17:53:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1koVYZ-0001Le-2V for pgsql-general@arkaria.postgresql.org; Sun, 13 Dec 2020 17:53:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koVYY-0001LV-L0 for pgsql-general@lists.postgresql.org; Sun, 13 Dec 2020 17:53:14 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1koVYR-0006NO-Bs for pgsql-general@postgresql.org; Sun, 13 Dec 2020 17:53:13 +0000 Received: by mail-ej1-x644.google.com with SMTP id j22so1408947eja.13 for ; Sun, 13 Dec 2020 09:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=uYj8NhileVBooh9Ddo9BrdAMmuOx/oBW8eWB3J3r6H8=; b=qzVd29kUwCN7TIISwkgZ/WMOcujNN3BOfWiDbXDId3quNButvHPNADL/rktQYkm99I JdoOMWothcIbSYr5YtG9eTH4Ps3w4YPN0oEjd2pLAExKHcZXtIcMwoLinZmiiiIZpjJn fr8XdhpvuUWOa9zMUKmpUb5WpbbqfJNlzJN9AlLBQUkpbzf43cUZCA+VPi2EQJj7YzHp vVUCRvr3UVlsyMIx/w0hn4QW6/DxHy/zMdEMISjTmvv9pzcNJgpj/0imK/Z1KSJp3KAn mpIey5l1lCNX0J681L3FxX8N3RnUWuZM+aW+p4e7wnoaGtzFi1IMY2UCaxHZZ045jrvH VfLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uYj8NhileVBooh9Ddo9BrdAMmuOx/oBW8eWB3J3r6H8=; b=SmeiICpU5LcRAjDtk4VGo4i7ev26+ErfPo2OjYKHdxhyxQXiyAx6U6mdM+Y36dXWfj 5DzyFZirt46vNDx2RAJeNqVaPixQtuzu0o6IdmwSDmYr/it6taC9OGTvwcpZvNE3weV+ jsMKi1eP0EhMrYZfaBOWd2GQ8fbR2WBxMnsomt0cWVjjsubQstUuxpoWjKOwfIRcwrM8 yh81+LjZzAOuA8zt51bJ5/IKHVMIvmDlkZHS0fJ2o+CpG5fuC0CyPbqAESJ9pHNIdZdq 2Md7KrNjKBM+Y4HCPd07wJiVY6ResDuG7/XosgTpoDszC88t3zxL6OZISU+8JyfEM6No zmDg== X-Gm-Message-State: AOAM530HkIJjECeDw1g57JwqcZtUt3dA0OiywfjK+eV88Z5JRUG94cqr W7SD+qy1KMjervYhT6H+ng/8COLCzOTx1XgwfqzTXu5M9igcmF31UWxuIEbmy2eLU36Ixf6nXLh zRkIgmpJ0V/Pu513NxdTWb5irQfw77Lj7SeViJ0clG57b0D58+E5iBzaOEm9h6lko1qSPkO8x7C zdyL8gitV3bohuO4lwV88o4Q6yY2iewyq0lfv7JgDDYNAyqiZ9NO1pgFXYfHuqbFs4biea0HoPL jw5PbG0PNIdywAMkxCpGltOajy2nfSxVRqV50IS X-Google-Smtp-Source: ABdhPJyQfxLJC26pSegpAJBKkdjkaQATxt9YUb53+kogxccKuvsUbfRI19/qBwoF64skH8oXa2UlmQ== X-Received: by 2002:a17:906:3553:: with SMTP id s19mr18924522eja.95.1607881984761; Sun, 13 Dec 2020 09:53:04 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-249-71.net.upcbroadband.cz. [86.49.249.71]) by smtp.gmail.com with ESMTPSA id p24sm10637195edr.65.2020.12.13.09.53.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Dec 2020 09:53:03 -0800 (PST) Subject: Re: Is there a way to dump schema to files on disk and keep them in sync To: Adrian Klaver , Tim Uckun , pgsql-general References: <94d0857d-fbeb-81d6-e285-f088e5efb472@aklaver.com> From: Tomas Vondra Message-ID: Date: Sun, 13 Dec 2020 18:53:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <94d0857d-fbeb-81d6-e285-f088e5efb472@aklaver.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/13/20 6:34 PM, Adrian Klaver wrote: > On 12/12/20 6:58 PM, Tim Uckun wrote: >> I want to dump my postgres schema to disk in neat directories like >> pgadmin presents. Then I want to be able to edit the files and sync >> changes to the database and ideally if changes were made in the >> database to sync them back to the disk. >> >> Is there a tool that does this? Is there a tool that will dump the >> schema into separate directories and files like pgadmin does? > > pgAdmin does not create directories, it just organizes the contents of > the system catalogs into GUI elements. > > For schema management I would suggest a tool like the one I use > Sqitch(https://sqitch.org/). It will organize the process of schema > creation and management. > Yeah, that was my thought too. Or maybe look at the other schema versioning tools available - we have a list on the wiki: https://wiki.postgresql.org/wiki/Change_management_tools_and_techniques I'm sure it's incomplete, but it's helpful nevertheless. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company