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 1egAC7-00012K-HA for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2018 14:13:59 +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 1egAC6-0006YA-FZ for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2018 14:13:58 +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.84_2) (envelope-from ) id 1egAC6-0006Y0-8y for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2018 14:13:58 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egAC1-0003NT-Vm for pgsql-hackers@postgresql.org; Mon, 29 Jan 2018 14:13:57 +0000 Received: from Davids-iMac.local (unknown [173.169.74.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 939E954662; Mon, 29 Jan 2018 14:13:50 +0000 (UTC) Subject: Re: PATCH: Exclude unlogged tables from base backups To: Masahiko Sawada Cc: Adam Brightwell , Robert Haas , Stephen Frost , PostgreSQL-development References: <04791bab-cb04-ba43-e9c0-664a4c1ffb2c@pgmasters.net> <20171212225234.jqdwd4sp663l4znp@alap3.anarazel.de> <5e428ad7-f37f-6479-aabf-2c8b9318fb79@pgmasters.net> <20171212230740.evr7rvkzz5bztdg6@alap3.anarazel.de> <20171213014804.GH4628@tamriel.snowman.net> From: David Steele Message-ID: <0d94b6fd-71fc-f7f7-790a-2a4cfbea514b@pgmasters.net> Date: Mon, 29 Jan 2018 09:13:49 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/29/18 5:28 AM, Masahiko Sawada wrote: > On Fri, Jan 26, 2018 at 4:58 AM, David Steele wrote: >> >> Attached is a new patch that uses stat() to determine if the init fork >> for a relation file exists. I decided not to build a hash table as it >> could use considerable memory and I didn't think it would be much faster >> than a simple stat() call. >> >> The reinit.c refactor has been removed since it was no longer needed. >> I'll submit the tests I wrote for reinit.c as a separate patch for the >> next CF. > > Thank you for updating the patch! The patch looks good to me. But I > have a question; can we exclude temp tables as well? The pg_basebackup > includes even temp tables. But I don't think that it's necessary for > backups Thank you for having another look at the patch. Temp tables should be excluded by this code which is already in basebackup.c: /* Skip temporary files */ if (strncmp(de->d_name, PG_TEMP_FILE_PREFIX, strlen(PG_TEMP_FILE_PREFIX)) == 0) continue; This looks right to me. Thanks, -- -David david@pgmasters.net