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 1iLyyP-0003xU-Mk for pgsql-general@arkaria.postgresql.org; Sun, 20 Oct 2019 00:21:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLyyO-0003a0-6c for pgsql-general@arkaria.postgresql.org; Sun, 20 Oct 2019 00:21:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLyyN-0003Zs-Sp for pgsql-general@lists.postgresql.org; Sun, 20 Oct 2019 00:21:27 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLyyF-0002Xr-On for pgsql-general@postgresql.org; Sun, 20 Oct 2019 00:21:27 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A37C421FC2; Sat, 19 Oct 2019 20:21:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 19 Oct 2019 20:21:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=y 7tQc/OJaNcuV9RkFfDhQ8BeIQjaTVzA09XcRQVHCgE=; b=29ZNpruHwKI/J3x7F NaQJvEz+USwonlO6bxRV1VkFdnwbqsEyHDgp3djz/5UjM3NNFNo3TToacs811H81 kxXfcXgxT9a70IZDT9b5X9KSWeGRxtu6k37LV//J0dlaYFuXtSYyYZ+hTJHXxi83 LmtCsRtPzAIDiUXHmxZbE/gTvEIsAbVmRfeaO4wh8l0V+3r7nPhihFQJ0nc8sD66 c1FCIWrRPpxdoBlYRf0u+1M+DSrB/86+cG40IQ5so8/bOg/c8znZdrKVXjPc92uO L+ErsbkxIlGWrAT/WLXrJfDERiKWUe7bCYVsPRZT9J7Fv2tyrw+2/yh4sXSymPWX U3YPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=y7tQc/OJaNcuV9RkFfDhQ8BeIQjaTVzA09XcRQVHC gE=; b=mfbXPLYfkC31txOZsldySkDJlod5trz7uKAtB2XIzgQU1pDlaht/YthSY QsbYiH4dCwCyhtlKl/G4zQ7lMkUFZuNZdV+UDtEu0cHcOX3Qmuc+joq23yaAIUYG GgPew1Q7l6phFvS/QGMyLcH9ACXE/Z7F/tNKmdOxubIvtzW67U6e9jjqifj1XmgW 4aj4ap7dVsBcS45r1dRUez1cWUp0jDDNCbN1X7+xm197wwtbeXnBJwJe3oOAIalk Ie0eQIUHZQX3fsw+A0sE4spIwJwD4sOnpmxJXGBQh7f0FSNJouL2aAydQcPXlpZu P+kDSnHB66Dd1EgUBsed1w5wM9gaA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrkedvgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefheenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepvdhnughquhgrughrrg hnthdrtghomhenucfkphepudejgedrvddurddugeehrddvfeehnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuve hluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.2] (174-21-145-235.tukw.qwest.net [174.21.145.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 05B298005B; Sat, 19 Oct 2019 20:21:17 -0400 (EDT) Subject: Re: releasing space To: Julie Nishimura References: <20191019124429.6htvmc7rhoc2m4hs@development> Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Sat, 19 Oct 2019 17:21:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/19/19 4:51 PM, Julie Nishimura wrote: > an entire cluster > > ------------------------------------------------------------------------ > *From:* Adrian Klaver > *Sent:* Saturday, October 19, 2019 4:34 PM > *To:* Julie Nishimura ; Tomas Vondra > > *Cc:* pgsql-general@lists.postgresql.org > ; pgsql-general > > *Subject:* Re: releasing space > On 10/19/19 4:17 PM, Julie Nishimura wrote: >> Thank you, Thomas. Do you know if it is safe to replicate 9.6.2 >> (smaller) db to 9.6.15 (larger capacity) using pg_basebackup? Would it >> be considered as an upgrade? > > pg_basebackup backups an entire Postgres cluster which will be many > databases. So when you say db do mean a Postgres cluster or an > individual database? > >> >> ------------------------------------------------------------------------ >> *From:* Tomas Vondra >> *Sent:* Saturday, October 19, 2019 5:44 AM >> *To:* Julie Nishimura >> *Cc:* pgsql-general@lists.postgresql.org >> ; pgsql-general >> >> *Subject:* Re: releasing space >> On Thu, Oct 17, 2019 at 05:20:09PM +0000, Julie Nishimura wrote: >>>Hello everybody, We are running PostgreSQL 9.6.2 cluster master -> >>>standby (streaming replication). 22 tb of space (constantly struggling >>>with the space, pruning the old data, but not fast enough). The biggest >>>db takes 16 tb. So, we've copied it to another server, and now we would >>>like to delete it from our original source, to free up the space. What >>>would be the right approach for this?  Just issue drop database command >>>(16tb). How long it might take? Should we do it gradually (drop biggest >>>tables first)? Any suggestions? Caveats? >>> >> >> Generally speaking, DROP DATABASE simply recursively drops all the >> various objects - indexes, tables, etc. It mostly just deleting the >> files, which should not be very expensive (we certainly don't need to >> delete all the data or anything), but there's certain number of I/O >> involved. But it does depend on the OS / filesystem / hardware if that's >> an issue. >> >> So if you want to be on the safe side, you can drop the objects one by >> one, with a bit of delay between them, to throttle the I/O a bit. >> >> FWIW the latest minor release for 9.6 is 9.6.15, you're 13 minor >> versions (~30 months) of fixes behind. You might want to consider >> upgrading ... >> >> >> -- >> Tomas Vondra http://www.2ndQuadrant.com >> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services > > > -- > Adrian Klaver > adrian.klaver@aklaver.com -- Adrian Klaver adrian.klaver@aklaver.com