<div dir="auto"><div>In several tests, I found the user running make check has to have rights to create the database postgis_reg or it fails immediately.  If the user can create a database but is not a superuser it fails with:</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">make -C core check</div><div dir="auto">.</div><div dir="auto">.</div><div dir="auto">.</div><div dir="auto">psql: FATAL:  permission denied to set parameter "lc_messages"</div><div dir="auto">Creating database 'postgis_reg'</div><div dir="auto">createdb: could not connect to database template1: FATAL:  permission denied to set parameter "lc_messages"</div><div dir="auto">psql: FATAL:  database "postgis_reg" does not exist</div><div dir="auto">Loading PostGIS into 'postgis_reg'</div><div dir="auto"> failed (Error encountered loading /home/pi/postgis-3.0.0dev/regress/00-regress-install/share/contrib/postgis/postgis.sql: /tmp/pgis_reg/regress_log)</div><div dir="auto">Makefile:212: recipe for target 'check' failed</div><div dir="auto">make[2]: *** [check] Error 1</div><div dir="auto">make[2]: Leaving directory '/home/pi/postgis-3.0.0dev/regress/core'</div><div dir="auto">Makefile:28: recipe for target 'check' failed</div><div dir="auto">make[1]: *** [check] Error 2</div><div dir="auto">make[1]: Leaving directory '/home/pi/postgis-3.0.0dev/regress'</div><div dir="auto">GNUmakefile:20: recipe for target 'check' failed</div><div dir="auto">make: *** [check] Error 1</div><div dir="auto"><br></div><div dir="auto">Only a superuser can <span style="font-family:sans-serif">parameter "lc_messages" so that is where it dies.</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">I agree on the face of it I cannot take over the rights of a user foo.  You only thing I can think of is somewhere in the script a command like </span></div><div dir="auto"><span style="font-family:sans-serif">sudo su $PGUSER</span></div><div dir="auto"><span style="font-family:sans-serif">is run.  That I have the rights to do with the user running make check.</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">Thanks</span></div><div dir="auto"><span style="font-family:sans-serif">Bruce</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Dec 18, 2018, 7:38 AM Greg Troxel <<a href="mailto:gdt@lexort.com">gdt@lexort.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bruce Rindahl <<a href="mailto:bruce.rindahl@gmail.com" target="_blank" rel="noreferrer">bruce.rindahl@gmail.com</a>> writes:<br>
<br>
> Doing some full compilation and checking on raspberry pi.  While running<br>
> make check, realized this has to be run as a postgresql superuser.  Suggest<br>
> adding to documentation it be run as:<br>
> PGUSER=foo make check<br>
> where foo is a superuser.<br>
<br>
Agreed on explaining that the user running make check needs to be able<br>
to do postgresql operations.   I guess it's an interesting question on<br>
whether that user needs to be a pgsql superuser, as that sort of<br>
indicates that postgis needs privs that perhaps it shouldn't.<br>
<br>
I don't follow how<br>
<br>
PGUSER=foo make check<br>
<br>
would work, unless you are assuming that you are running as root.  A<br>
normal user should not be able to obtain another user's permissions just<br>
by asking.<br>
<br>
I typically do postgis packaging/testing on a machine that does not have<br>
a production database, and run builds/tests as a non-root user that is a<br>
pgsql su.<br>
<br>
</blockquote></div></div></div>