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 1lN1iM-0007VS-5t for pgsql-general@arkaria.postgresql.org; Thu, 18 Mar 2021 23:06:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lN1iJ-0006FA-J7 for pgsql-general@arkaria.postgresql.org; Thu, 18 Mar 2021 23:05:59 +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 1lN1iI-0006F3-3x for pgsql-general@lists.postgresql.org; Thu, 18 Mar 2021 23:05:59 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lN1iF-0003w8-7O for pgsql-general@lists.postgresql.org; Thu, 18 Mar 2021 23:05:57 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 3B75310A9; Thu, 18 Mar 2021 19:05:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 18 Mar 2021 19:05:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=k NjSh4BahaoKmGlg4U+d8I/SPVVZF7YVD+gq4PCfJWg=; b=EIyn4Wjtfaj9wOPDv THEzKRqWpRRwXj/KQrzAUr/5RG7XZh0qBWvGS7LjGoizAkIYKkMeogxwaU2yLvul 5AZz/R5HrsTZw4r2wG4AYCz4ElZNoaWonsRv7/QLyI5wHLau0EEKuxcRfAGuGyFa VUjxkIsnmIbyG4Dqt7R7QKtSWD6h0DPnb4PNYF0c7cem4yzWE+fn96Lvt6yM6g2U nzaDZWTNX32tZCZZICgMIb+dIiT6iqoHvyKNgZqMJHKLdaJ/Z2kRKeVAay5nhgm0 1hTWz9CMdud694O1ZOv6EOafD0xayFLqtTpFecTdqn1xjKqyFXh5y79eshFssloc LXIsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=kNjSh4BahaoKmGlg4U+d8I/SPVVZF7YVD+gq4PCfJ Wg=; b=U4nd+s34QeyeRpasdA4NsaYXKlV7AyWBxsXX44yGEn+tvU0B46EmgE35L 2hNGqs/TmR7NSG/m1QhqXJQgDoPq3Uwz7q8gYSBaPDcV3mS85O8aIda0fnc98XiC L6b/ek3Do7kQq7RpugtDKNwRaW76PSXMpKYdQ/y179DMT26hk7o40IOxtBG0yrFh /BV97EESSSkknIcsLbV/dg8//CNYGutVJrdwV4mlP6Veo/cAVbMaOEyA9P5bX2No x0dVykyD4QnZsAoW/wwzJqKQNKcPkV16RSGiOzv2HQYZYHwNXYq+aFlzr5jATs8F yiEqB/ANPfAR1wJyZn6Pmv5EYnafg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefjedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevteejtdeikeetfefhhffhteelvdekffevudegjeeu kefhgfdvieeliedtkeevhfenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cukfhppeeljedruddufedrvddujedrvdejnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrh drtghomh X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id B226524005B; Thu, 18 Mar 2021 19:05:51 -0400 (EDT) Subject: Re: Drop Database To: Gustavo FERREYRA , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Thu, 18 Mar 2021 16:05:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/18/21 3:39 PM, Gustavo FERREYRA wrote: > Hello, a request, which may be resolved in another way and I did not see it. > When doing a BACKUP plain and using "Include DROP DATABASE statement", > could you add by default "IF EXISTS" ? https://www.postgresql.org/docs/12/app-pgdump.html --if-exists Use conditional commands (i.e., add an IF EXISTS clause) when cleaning database objects. This option is not valid unless --clean is also specified. > Because when doing a restore, if the database does not exist, it gives > an error and you have to edit the file to comment out the line. Which should not be causing an issue. > Thanks for your work and congratulations, it is a very useful and > beautiful tool. > Greetings cordially. > -- Adrian Klaver adrian.klaver@aklaver.com