<div dir="ltr"><div><div>Package: postgresql-common</div><div>Version: 184</div><div>Severity: normal</div></div><div><br></div><div>This is suggesting a fix for the recent autopkgtest errors like [1], more of them at [2].</div><div><br></div><div>TL;DR:</div><div>- we should add an unconditional pg_updatedicts on "configure" in the postinst.</div><div>- This bug is explaining the details and polling for opinions on adding that line</div><div><br></div><div>Details:<br></div><div><br></div><div>Formerly e.g. version 181 when installing on a clean system created /var/cache/postgresql:</div><div>$ ls -dlaF /var/cache/postgresql</div><div>ls: cannot access '/var/cache/postgresql': No such file or directory</div><div>$ sudo apt install postgresql-common</div><div>[...]</div><div>$ ls -dlaF /var/cache/postgresql</div><div>drwxr-xr-x 3 root root 4096 Jul 13 07:43 /var/cache/postgresql/</div><div><br></div><div><br></div><div>But now e.g. with version 184 it doesn't do that anymore:</div><div>$ ls -dlaF /var/cache/postgresql</div><div>ls: cannot access '/var/cache/postgresql': No such file or directory</div><div>$ sudo apt install postgresql-common</div><div>[...]</div><div>$ ls -dlaF /var/cache/postgresql</div><div>ls: cannot access '/var/cache/postgresql': No such file or directory</div><div><br></div><div><br></div><div>The reason is the dropping of the following statement that was considered to be no more needed:</div><div>if dpkg --compare-versions "$2" lt 94; then</div><div> pg_updatedicts || true</div><div>fi</div><div><br></div><div>I agree version 94 is long ago.</div><div>But since then, due to a mistake, this always was an unconditional pg_updatedicts call on first install.</div><div><br></div><div>Quote from dpkg:</div><div>"These treat an empty version as earlier than any version: lt le eq ne ge gt."</div><div><br></div><div>Now on a new install of postgresql-common $2 is empty and so this triggered on first install since version 95.</div><div><br></div><div>That in turn might seem unimportant, but affects cases where the first pg_updatedicts that is executed is under special conditions.</div><div>Exactly that happens on the autopkgtests of postgresql-9.6 (or later).</div><div>There the test dependencies install postgresql-common, as outlined above now without calling pg_updatedicts.</div><div>Due to that the directory does not exist when the tests themselves call pg_updatedicts to update the dicts.</div><div><br></div><div>But because they do so with a umask o 077</div><div>postgresql-common-184/testsuite:</div><div> 22 : ${PG_UMASKS="077"} # default umask(s) to try </div><div>[...]</div><div>169 umask $U</div><div>[...]</div><div>Finally t/150_tsearch_stemming.t will all pg_updatedicts in that env</div><div>But due to the umask it is created as</div><div>drwx------ 3 root root 4096 Jul 13 07:43 /var/cache/postgresql/</div><div><br></div><div>And that finally lets the test fail with an issue like in [1]</div><div>=== Running test 150_tsearch_stemming.t ... ===</div><div>[...[</div><div>not ok 9 - creating en_US full text search configuration ERROR: could not open dictionary file "/usr/share/postgresql/9.6/tsearch_data/en_us.dict": Permission denied</div><div><br></div><div>Ok, long story short - we should make sure the base directory is created correctly on postinst.</div><div>Therefor I suggest really adding an unconditional pg_updatedicts in there.</div><div>The postrm already has the matching rm to clean the dir up btw.</div><div><br></div><div><br></div><div>[1]: <a href="https://ci.debian.net/data/autopkgtest/unstable/amd64/p/postgresql-9.6/20170713_010956/log.gz">https://ci.debian.net/data/autopkgtest/unstable/amd64/p/postgresql-9.6/20170713_010956/log.gz</a><br></div><div><div>[2]: <a href="https://ci.debian.net/packages/p/postgresql-9.6/unstable/amd64/">https://ci.debian.net/packages/p/postgresql-9.6/unstable/amd64/</a></div></div><div><div><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div>
</div>