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 1oU5HE-00008O-FP for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2022 11:56:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oU5HD-0003hN-7h for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2022 11:55:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oU5HC-0003hD-Ue for pgsql-hackers@lists.postgresql.org; Fri, 02 Sep 2022 11:55:58 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oU5HA-0002WT-NM for pgsql-hackers@lists.postgresql.org; Fri, 02 Sep 2022 11:55:58 +0000 Received: by mail-il1-x12c.google.com with SMTP id h14so984946ilh.10 for ; Fri, 02 Sep 2022 04:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=GnSN/TmS40vdESWIapqz5iegkTbAuJjFwfbew0vhHW4=; b=Q2eqQlsRcryz9UZbTv3L7jF/qR6L01OEgov40Cky+OcmwxhdvMsatcw5ermdGFZ8wz RMF0vSFbEOftt3o8vLSL/06qWSzH2lTrXq1DvqPDMULI5JlwJl0YeCT2GDwIuzyuktf5 inEmDIhX7lp8FLTYn06YctJTBn2fxKPPgngHGBhP9Er2pVmTc6r5OeNWauHz4nBXbNgf Zpm+v+Wa0Crqr8UEe2Pm5uURf+1ZVGO8GV4Oqt9ocKnOgc2lJosJMZZH2aDONdbVGpQO iVl0YmP6OCS1b+QoWruOM8BZwnYEfqWD+Hzx3Qj3szykz27l8q5vebmtT/Sbia+r5JPp n9yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=GnSN/TmS40vdESWIapqz5iegkTbAuJjFwfbew0vhHW4=; b=Qo/TFPbaBvsRR3R7awPnGWX9EQasCDAns4paZh5e3xrrGpnQOeibASv1qPuoFTdNgP AGJGVWSMVwykVTVSRxNOG6MmktAvLhaF4swc96hJAtyBnAsS1m2FfkiPMxjc4ZHAR+x4 pIeiShCFv0EHmXrshYtcW3w2Ya4ACg9Sq61RRDTNDlQTG5RH7BZxvyUoMvjSWfzW0BC4 hw7ct1gkS00cCzTs8hqZfLx/ocMlbLl0Td+qhD87GvlqeQzQPaoe5KcEBCW0S7p/HQ5w ww9DEgEBNcVbDQWd6wtSVInyhbMiQCVgWNFbQfpEZpAumcN3/jeYsairaFvjfU8EUfTK 2J4A== X-Gm-Message-State: ACgBeo3B4FkauXaLWfcfN/P/BPZiO+KDuz5T7cTdVzxrv2bGzEBOCwSA usBnrB/Ty5mwv7CSwsY2AU9T1w== X-Google-Smtp-Source: AA6agR5jq27O5A6XEHkXYuDXDIv08XUgHit0eUuZ+f+kWu2kWtJdctBxfJjPT0sAilai4GabghWPsQ== X-Received: by 2002:a92:db04:0:b0:2e5:dbb6:1285 with SMTP id b4-20020a92db04000000b002e5dbb61285mr19125149iln.275.1662119754580; Fri, 02 Sep 2022 04:55:54 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id f22-20020a056638113600b00349bb70ab9fsm767025jar.152.2022.09.02.04.55.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2022 04:55:53 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D1F39800DDD; Fri, 2 Sep 2022 06:55:52 -0500 (CDT) Date: Fri, 2 Sep 2022 06:55:52 -0500 From: Justin Pryzby To: Robert Haas , Tom Lane Cc: Dilip Kumar , Andres Freund , Ashutosh Sharma , Maciek Sakrejda , Bruce Momjian , Alvaro Herrera , Andrew Dunstan , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org, Thomas Munro Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints Message-ID: <20220902115552.GZ31833@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220804221604.GO19644@telsasoft.com> <20220802175043.GA13682@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 02, 2022 at 12:50:43PM -0500, Justin Pryzby wrote: > Also, if I understand correctly, this patch seems to assume that nobody is > connected to the source database. But what's actually enforced is just that > nobody *else* is connected. Is it any issue that the current DB can be used as > a source? Anyway, both of the above problems are reproducible using a > different database. > > |postgres=# CREATE DATABASE new TEMPLATE postgres STRATEGY wal_log; > |CREATE DATABASE On Thu, Aug 04, 2022 at 05:16:04PM -0500, Justin Pryzby wrote: > On Thu, Aug 04, 2022 at 06:02:50PM -0400, Tom Lane wrote: > > The "invalidation" comment bothered me for awhile, but I think it's > > fine: we know that no other backend can connect to the source DB > > because we have it locked, > > About that - is it any problem that the currently-connected db can be used as a > template? It's no issue for 2-phase commit, because "create database" cannot > run in an txn. Would anybody want to comment on this ? Is it okay that the *current* DB can be used as a template ?