0001 adds the \getenv command to psql; now with documentation and a simple regression test.
+1. Wish I had added this years ago when I had a need for it.
0002 tweaks pg_regress to export the needed values as environment variables, and modifies the test scripts to use those variables. (For ease of review, this patch modifies the scripts in-place, and then 0003 will move them.) A few comments on this:
* I didn't see any value in exporting @testtablespace@ as a separate variable; we might as well let the test script know how to construct that path name.
* I concluded that the right way to handle the concatenation issue is *not* to rely on SQL literal concatenation, but to use psql's \set command to concatenate parts of a string. In particular this
+1 to that, much better than the multi-line thing.
I have a nitpick about the \getenv FOO FOO lines.
It's a new function to everyone, and to anyone who hasn't seen the documentation it won't be immediately obvious which one is the ENV var and which one is the local var. Lowercasing the local var would be a way to reinforce which is which to the reader. It would also be consistent with var naming in the rest of the script.
0004 finally removes the no-longer-needed infrastructure in