Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lV3y0-0000PG-7a for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Apr 2021 03:07:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lV3xy-0006Rr-4N for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Apr 2021 03:07:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lV3xx-0006Rk-Ke for pgsql-hackers@lists.postgresql.org; Sat, 10 Apr 2021 03:07:21 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lV3xq-0006Kj-Vd for pgsql-hackers@lists.postgresql.org; Sat, 10 Apr 2021 03:07:20 +0000 Received: by mail-pj1-x1033.google.com with SMTP id lr1-20020a17090b4b81b02900ea0a3f38c1so7310163pjb.0 for ; Fri, 09 Apr 2021 20:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9p/cZ3WEC86SRExyNh3s9lT96M5YjV3zcclhdA66UQM=; b=bPIMhDHXqVQFdfk2KwCcWbwJiOCrjPodBrexGj/rz8WxIoXjA3GR+WvSy8OjZ7jP/G gUbtGBmhCdlY0Z2Bn/qNJYmircEFg12nIH6BUPW3LJFOwWCR8D2vvIaZz9lhr9xrpTF0 xrvpDEAEvRJ5dcAbnyc63/oZ6XkluQJt64pmg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9p/cZ3WEC86SRExyNh3s9lT96M5YjV3zcclhdA66UQM=; b=H4RHGr9E8ov4iahxBoM8iAbXFV8HWgdIzSaWGLb+D6N9OQbmHn+xDBokQRe3WeHMwQ ad7/oGUTSPfstgTpUGBODi/tTMcLHNua+vP6wV9VTGzF1Rx11OJ40EiPh0mVxw4XSHQJ OFmKwVc2SHLV9wLt9OXXbKUL9xj/AhqR3dpb+hvSqHKb9kGloePEgC2RNBdTJoXylptF GMfwfB2VagTyF29uMYSI6N637w/x+jSZGjRvv/xSpjNdZOj1vxdJwiGuWt0KvfsKlb1e QAEEG2jgv/QQze62pRCby0r9UPKKWg6naHaLcZgXT+1/BS5kUUSHSqJcPMzEULBru93c VwvQ== X-Gm-Message-State: AOAM530QoqxYzQ+1udFyhe0PXhfAABJp9MuwfCUWQMl8Q8bgT65bx4pX z9mGxMTa8Hfy78kohbaJJrqzcw== X-Google-Smtp-Source: ABdhPJy/4n0xDlWmMRgMDKTvA+LcApFSiTYcPSo6CtDyAqHrNH0WhXdKhr7mpsgWf/NZq7oIwER+zg== X-Received: by 2002:a17:90b:4c0c:: with SMTP id na12mr16033179pjb.117.1618024033792; Fri, 09 Apr 2021 20:07:13 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id x33sm3350596pfu.71.2021.04.09.20.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Apr 2021 20:07:13 -0700 (PDT) Date: Fri, 9 Apr 2021 20:07:10 -0700 From: Noah Misch To: Michael Paquier Cc: Robert Haas , Christoph Berg , PostgreSQL Hackers Subject: Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres Message-ID: <20210410030710.GB978274@rfd.leadboat.com> References: <20210325025659.GA4017435@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Apr 09, 2021 at 03:00:31PM +0900, Michael Paquier wrote: > I have compiled a simple patch that uses a SQL function for the base > tablespace directory creation, that I have tested on Linux and MSVC. > I am still not sure if people would prefer this approach over what's > on HEAD. So if there are any opinions, please feel free. "pg_regress --outputdir" is not a great location for a file or directory created by a user other than the user running pg_regress. If one does "make check" and then "make installcheck" against a cluster running as a different user, the rmtree() will fail, assuming typical umask values. An rmtree() at the end of the tablespace test would mostly prevent that, but that can't help in the event of a mid-test crash. I'm not sure we should support installcheck against a server running as a different user. If we should support it, then I'd probably look at letting the caller pass in a server-writable directory. That directory would house the tablespace instead of outputdir doing so.