Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-13 Thread Michael Paquier
On Mon, Apr 12, 2021 at 10:36:10PM -0700, Noah Misch wrote: > Christoph Berg's first message on this thread reported doing that. If > supporting server_user!=pg_regress_user is unwarranted and Christoph Berg > should stop, then already-committed code suffices. Not sure that we have ever claimed t

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-12 Thread Noah Misch
On Mon, Apr 12, 2021 at 02:25:53PM +0900, Michael Paquier wrote: > On Fri, Apr 09, 2021 at 08:07:10PM -0700, Noah Misch wrote: > > "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

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-12 Thread Christoph Berg
Re: Michael Paquier > http://commitfest.cputube.org/michael-paquier.html > > So it looks like this could be a different answer. The mkdir() function looks like a sane and clean approach to me. Christoph

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-11 Thread Michael Paquier
On Fri, Apr 09, 2021 at 08:07:10PM -0700, Noah Misch wrote: > "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

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-09 Thread Noah Misch
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 th

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-04-08 Thread Michael Paquier
On Wed, Mar 24, 2021 at 07:56:59PM -0700, Noah Misch wrote: > That would entail forbidding various shell metacharacters in @testtablespace@. > One could avoid imposing such a restriction by adding a mkdir() function to > regress.c and writing it like: > > CREATE FUNCTION mkdir(text) >RETURNS v

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Noah Misch
On Thu, Mar 25, 2021 at 07:44:02AM +0900, Michael Paquier wrote: > On Wed, Mar 24, 2021 at 10:50:50AM -0400, Robert Haas wrote: > > On Wed, Mar 24, 2021 at 5:56 AM Christoph Berg wrote: > >> Maybe creating the tablespace directory from within the testsuite > >> would suffice? > >> > >> CREATE TABL

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Michael Paquier
On Wed, Mar 24, 2021 at 10:50:50AM -0400, Robert Haas wrote: > On Wed, Mar 24, 2021 at 5:56 AM Christoph Berg wrote: >> Maybe creating the tablespace directory from within the testsuite >> would suffice? >> >> CREATE TABLE foo (t text); >> COPY foo FROM PROGRAM 'mkdir @testtablespace@'; >> CREATE

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 5:56 AM Christoph Berg wrote: > Maybe creating the tablespace directory from within the testsuite > would suffice? > > CREATE TABLE foo (t text); > COPY foo FROM PROGRAM 'mkdir @testtablespace@'; > CREATE TABLESPACE regress_tblspace LOCATION '@testtablespace@'; Would that

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Christoph Berg
Re: Michael Paquier > So you basically mimicked the makefile rule that this commit removed > into your own test suite. Reverting the change does not really help, > because we'd be back to square one where there would be problems in > parallel runs for developers. Saying that, I would not mind add

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-23 Thread Michael Paquier
On Tue, Mar 23, 2021 at 12:50:29PM +0100, Christoph Berg wrote: > I'm working around the problem now by running the tests as user > "postgres", but does completely break in environments where users want > to run the testsuite from a separate compilation user but don't have root. > > Old code: > h

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-23 Thread Christoph Berg
Re: Michael Paquier > Move tablespace path re-creation from the makefiles to pg_regress > > Moving this logic into pg_regress fixes a potential failure with > parallel tests when pg_upgrade and the main regression test suite both > trigger the makefile rule that cleaned up testtablespace/ under >