Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f74RX-0008SE-UP for pgsql-general@arkaria.postgresql.org; Fri, 13 Apr 2018 19:33:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f74RX-00046x-5k for pgsql-general@arkaria.postgresql.org; Fri, 13 Apr 2018 19:33:07 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f74Nx-0003m6-Ia for pgsql-general@lists.postgresql.org; Fri, 13 Apr 2018 19:29:25 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f74Nt-0000TH-8G for pgsql-general@lists.postgresql.org; Fri, 13 Apr 2018 19:29:23 +0000 Received: by mail-qt0-x242.google.com with SMTP id a25so2894502qtm.1 for ; Fri, 13 Apr 2018 12:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LNwR0z5lYdK9FYt+3XNke1il2pS6XoUHsiJb9G7mmUo=; b=FuheOo1LyC39kYU59vDHyGfljOCfHjLSHIlDv357eF0niZB1QeL6HWDwU6yTWo2DLo 7fs8IEa1M1zlak9uOAW0+vlxIYvNRwoC7sQVDFoykwQFm9h1fLpySoBZiSHAFHZ9k6Zx +D2nRLSglLJpZrLUPZiBKjK0SCMM92HZQ4L01STYp+eZwRT1zydwgKui6Nk3QYZmmi0s Kn5iRA48A6bdUlL7yzA2v5Mzrbu0374s7k7JGEAF8XrX5g6kjeJYkzCeBq0o2mgaF5wQ YNn42Nvfz7LEYK7ME8PqhxjwtUZSm+iZ862XLgtaSoRT4/dcSTe3xO/+M/nlFzwba2z9 fRJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LNwR0z5lYdK9FYt+3XNke1il2pS6XoUHsiJb9G7mmUo=; b=n5FYHYMqxSws7wtjrxEFnj+lCyt9bYzv3nhC0HNUPfSlZKKo+l4akiwOH0LdtULl9H CGK9JrLGF+5OgoBJPGW1MVh99pmHiOfL7zGIrC6nGHMttu8N+KBVvRgKVX11e874dnon 4n8+rMdMUNJHPis/IhF51QELSvx2t4+Z8ztLph4InG4GVverRCqPQ2RTRPw8jAX7OdkH BHczLdqEVq9TYD8PSVQyn4sW47dcVR24jztAgi0U2pSZOw5+HWWjDuo43XyyDo8lF2dJ eW64PxDx4jceYrLzhLQ2WWpUcclBU7aSRHr3HFrVrn3nWfA47T325VVGd46D3Knl9/PW T4wA== X-Gm-Message-State: ALQs6tBRuWkvmq/n6ft286o5L7Jwknp732fXNSJVJSeXGwf3WD7sSEHr WwAIrigZbp/rx7EmHPvotEk= X-Google-Smtp-Source: AIpwx48r1WxWpBI5R5A8CKRLax33WxRSM5XCDvqE76rTPUwXQOxBz+5W3Q/zk/lvRjlVxk/XjeAaug== X-Received: by 10.200.12.13 with SMTP id k13mr4591819qti.281.1523647758881; Fri, 13 Apr 2018 12:29:18 -0700 (PDT) Received: from [10.1.0.27] (c-73-147-125-238.hsd1.va.comcast.net. [73.147.125.238]) by smtp.gmail.com with ESMTPSA id a28sm5424737qkj.28.2018.04.13.12.29.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 12:29:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: how to securely delete the storage freed when a table is dropped? From: Ozz Nixon In-Reply-To: <81f77dea-32bf-a5d7-5a9c-c70a42b4f155@gmail.com> Date: Fri, 13 Apr 2018 15:29:16 -0400 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <972AE690-41C9-4F8D-856B-A22F462F5885@gmail.com> References: <81f77dea-32bf-a5d7-5a9c-c70a42b4f155@gmail.com> To: Ron X-Mailer: Apple Mail (2.3445.5.20) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk There are free utilities that do government leave wipes. The process = would be, drop the table, shrink the old table space then (if linux = based), dd fill the drive, and use wipe, 5x or 8x deletion to make sure = the drive does not have readable imprints on the platers. Now what Jonathan mentions - sounds like he wants to do the same to the = physical table. Never dabbling into PSQL=E2=80=99s storage and = optimization algorithms, I would first assume, a script to do a row by = row update table set field1=E2=80=A6fieldx, different data patterns, = existing field value length and field max length. Run the script at = least 5 to 8 times, then drop the table .. the problem will be, does = PSQL use a new page as you do this, then you are just playing with = yourself. Let alone, how does PSQL handle indexes - new pages, or = overwrite the existing page? And is any NPI (Non-Public-Info) data in = the index itself? * So any PSQL core-engine guys reading? O. > On Apr 13, 2018, at 3:03 PM, Ron wrote: >=20 >=20 >=20 > On 04/13/2018 12:48 PM, Jonathan Morgan wrote: >> For a system with information stored in a PostgreSQL 9.5 database, in = which data stored in a table that is deleted must be securely deleted = (like shred does to files), and where the system is persistent even = though any particular table likely won't be (so can't just shred the = disks at "completion"), I'm trying to figure out my options for securely = deleting the underlying data files when a table is dropped. >>=20 >> As background, I'm not a DBA, but I am an experienced implementor in = many languages, contexts, and databases. I've looked online and haven't = been able to find a way to ask PostgreSQL to do the equivalent of = shredding its underlying files before releasing them to the OS when a = table is DROPped. Is there a built-in way to ask PostgreSQL to do this? = (I might just not have searched for the right thing - my apologies if I = missed something) >>=20 >> A partial answer we're looking at is shredding the underlying data = files for a given relation and its indexes manually before dropping the = tables, but this isn't so elegant, and I'm not sure it is getting all = the information from the tables that we need to delete. >>=20 >> We also are looking at strategies for shredding free space on our = data disk - either running a utility to do that, or periodically = replicating the data volume, swapping in the results of the copy, then = shredding the entire volume that was the source so its "free" space is = securely overwritten in the process. >>=20 >> Are we missing something? Are there other options we haven't found? = If we have to clean up manually, are there other places we need to go to = shred data than the relation files for a given table, and all its = related indexes, in the database's folder? Any help or advice will be = greatly appreciated. >=20 > I'd write a program that fills all free space on disk with a specific = pattern. You're probably using a logging filesystem, so that'll be far = from perfect, though. >=20 > --=20 > Angular momentum makes the world go 'round. >=20