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 1f4gu3-0008Jm-Dk for pgsql-general@arkaria.postgresql.org; Sat, 07 Apr 2018 06:00:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4gu1-0007sT-Mr for pgsql-general@arkaria.postgresql.org; Sat, 07 Apr 2018 06:00:41 +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 1f4gu1-0007sJ-FF for pgsql-general@lists.postgresql.org; Sat, 07 Apr 2018 06:00:41 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f4gty-0003qF-1g for pgsql-general@postgresql.org; Sat, 07 Apr 2018 06:00:40 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1f4grq-0001kd-P0 for pgsql-general@postgresql.org; Sat, 07 Apr 2018 07:58:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-general@postgresql.org From: Thomas Kellerer Subject: Re: dealing with lock Date: Sat, 7 Apr 2018 08:00:29 +0200 Lines: 12 Message-ID: References: <1523027471.3170.10.camel@cybertec.at> <53e9c170-f14a-e71e-b973-0325702cc6b5@aklaver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <53e9c170-f14a-e71e-b973-0325702cc6b5@aklaver.com> Content-Language: de-DE X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver schrieb am 07.04.2018 um 00:02: >> Is there a way to identify the list of statements that have to rewrite the table. > > https://www.postgresql.org/docs/10/static/sql-altertable.html > > Notes > > "Adding a column with a DEFAULT clause or changing the type of an existing column will require the entire table and its indexes to be rewritten. Note that this will change with Postgres 11 https://www.depesz.com/2018/04/04/waiting-for-postgresql-11-fast-alter-table-add-column-with-a-non-null-default/