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 1l1ol1-00075r-9W for pgsql-admin@arkaria.postgresql.org; Tue, 19 Jan 2021 11:01:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1ol0-0000K6-7A for pgsql-admin@arkaria.postgresql.org; Tue, 19 Jan 2021 11:01:06 +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 1l1okz-0000Jz-Vr for pgsql-admin@lists.postgresql.org; Tue, 19 Jan 2021 11:01:05 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l1okv-0004gS-4J for pgsql-admin@lists.postgresql.org; Tue, 19 Jan 2021 11:01:05 +0000 Received: by mail-ed1-x52a.google.com with SMTP id p22so20946915edu.11 for ; Tue, 19 Jan 2021 03:01:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=7oV7Qf9d0IYiT2R3uPwGlk6AJMPxYygBTxY2oK0kx70=; b=EaqcAuYERUC7Y3KRKM9f5eCm5oz+2LjIflXUzowNLd1Z3k8DypEKil6XF15pT06r0X ULnmOgcoTnV4z3BZrThnDm8cJPB4A6cbJTseSecJF43AZ3pMrytJl4H+UEUoDcXMdJdF qdX5/DRQBE58iCSFdYt5Fty79U/13d2KGhRWcMzoW02NtaHOX+Xs4FAG33tj8f44uIz3 hUnBaBL3OztYkF25LgeKWYoe62Qcti/EfA1wETJyrpjMz2jzKRivRxptFBFbqSAeIiJZ Ec4T/CAE/VLqaDLimsAg8gFWU792QcKzd353t3fkTPuC21XNk0t1KEHlWp2SD7EBoMMv wi6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=7oV7Qf9d0IYiT2R3uPwGlk6AJMPxYygBTxY2oK0kx70=; b=o834YTkHGarYdIBvoUhylF+FeQtZ9iFcWvg9b9IZinApalK/GSJj+02cW9MsWZQJGa nIg3jslcYrm307WtkcmbRp2AggRg2TPZ159Bv0BAVUp+sgr7rcxUwHYv2k7eIPjMfz7C j//tLiF0cig3il9A+XEXjXHBJy73A6/HSrWlc1831Pui+zVTD5tysuHZGq2KKrGAdxzT H7x/DpstToPmXsnxfngGlbIHE4z+NtWQit0JhCvNlwVd9zTNFOHPOOatVbTG5gPcJUtZ G7r52MCZRYiBJqXnFVySoxB+qARSSOzP127ym4owxATJU28cQGt6xh8D72pC3ae3CCC3 2SeA== X-Gm-Message-State: AOAM53124FBLL8jRyS9QDbQCvJw6A5rjtpuRuGbor92R8iINNkNYT2wo QAqO7qZBsmyATsFylOp6ivWToQ== X-Google-Smtp-Source: ABdhPJwFc9qvEtxH1nvq6octwzSKVlDf+Iwni/EaYpnDzpqQR8RssH0obFBFbvFnx0+7FlYoZbzwxA== X-Received: by 2002:a05:6402:144:: with SMTP id s4mr2987631edu.63.1611054060346; Tue, 19 Jan 2021 03:01:00 -0800 (PST) Received: from localhost.localdomain (62-46-248-242.adsl.highway.telekom.at. [62.46.248.242]) by smtp.gmail.com with ESMTPSA id w12sm6307884edr.29.2021.01.19.03.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 03:00:59 -0800 (PST) Message-ID: <97a174024075f2cef97b626bd792bfe0ceae7e08.camel@cybertec.at> Subject: Re: Clean Postgres shutdown From: Laurenz Albe To: Yambu , Pgsql-admin Date: Tue, 19 Jan 2021 12:00:59 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2021-01-19 at 12:10 +0200, Yambu wrote: > Is there a clean way to shutdown postgres which completes transactions and does not abort them. > > I ran #systemctl stop postgresql-10 > > 2021-01-18 14:31:28.600 GMT [10594] LOG: received fast shutdown request > 2021-01-18 14:31:28.603 GMT [10594] LOG: aborting any active transactions > 2021-01-18 14:31:28.607 GMT [10594] LOG: worker process: logical replication launcher (PID 10604) exited with exit code 1 > 2021-01-18 14:31:28.613 GMT [10598] LOG: shutting down > 2021-01-18 14:31:28.634 GMT [23850] FATAL: the database system is shutting down > 2021-01-18 14:31:29.119 GMT [10594] LOG: database system is shut down Yes, that is the "smart" shutdown mode that will wait for all sessions to finish. Admitted, that's not the same as waiting for the end of the *transaction*, but it is the closest thing we have. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com