Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecZbw-00068y-MV for pgsql-docs@arkaria.postgresql.org; Fri, 19 Jan 2018 16:33:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecZbw-0001Pc-9C for pgsql-docs@arkaria.postgresql.org; Fri, 19 Jan 2018 16:33:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecZbw-0001PP-0p for pgsql-docs@lists.postgresql.org; Fri, 19 Jan 2018 16:33:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ecZbt-00059Q-1u for pgsql-docs@lists.postgresql.org; Fri, 19 Jan 2018 16:33:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w0JGXhhL021888; Fri, 19 Jan 2018 11:33:43 -0500 From: Tom Lane To: ilsa@ilsadee.com cc: pgsql-docs@lists.postgresql.org Subject: Re: What does "Table rewrite" mean? In-reply-to: <20180119160340.3623.98926@wrigleys.postgresql.org> References: <20180119160340.3623.98926@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Doc_comments_form?= message dated "Fri, 19 Jan 2018 16:03:40 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21886.1516379623.1@sss.pgh.pa.us> Date: Fri, 19 Jan 2018 11:33:43 -0500 Message-ID: <21887.1516379623@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Doc_comments_form?= writes: > What does a table rewrite do? Does it drop and recreate the table? > Everywhere I look people describe it with fear and trepedation as if it was > some catastrophically dangerous operation to perform. What is it? It means reading the whole table and writing it out in some modified form (for instance, with some column transformed into a new datatype). It's not "dangerous" in any way ... but if you've got many GB of data in the table and you can't afford to have the table locked for a long time, then it's something to avoid. regards, tom lane