<div dir="ltr"><div><div><div><div><div><div><div>Hello guys,<br><br>I have test slackbuild (see attachment). The scenario for using package produced by this<br>slackbuild would be the following:<br><br></div>1) You don't have PostgreSQL installed. Install package, business as usual<br>
<br></div><div>2) You have PostgreSQL installed, don't care for in-place upgrades:<br></div><div> Create backups, remove/upgrade PostgreSQL, load the backups<br></div><br>3) You have PostgreSQL installed (let's say 9.x series, or at least 8.3)<br>
</div><div> You want to do in-place testing (two running PostgreSQL instances) and upgrade<br> using pg_upgrade<br></div><div><br></div>3.1) Make sure you have backups<br></div><br>3.2) Build new PostgreSQL 9.3<br></div>
<br>3.3) Install new PostgreSQL 9.3, while keeping the old package installed as well<br> - Please note that new PostgreSQL will have binaries in /usr/lib64/postgresql/9.3/bin,<br> and install script create symlinks in /usr/bin only if respective postgresql binaries are<br>
not found in /usr/bin (i.e. it will _not_ overwrite your PostgreSQL 9.x binaries!)<br></div></div><div> - Libraries will be kept as well (new install location for libraries is<br> /usr/lib64/postgresql/9.3/lib)<br>
</div><div> - Shared data, documents, include files will be overwritten<br></div><div><br>3.4) Make sure new rc.postgresql script is active<br></div><div> - You can manage old PostgreSQL versions (< 9.3) by using:<br>
PG_VERSION=9.2 /etc/rc.d/rc.postgresql start|stop|...<br></div><div> - Use PG_VERSION=9.2 for v9.2.x and older PostgreSQL versions<br></div><div> - You can even specify port (port number is used for sockets as well):<br>
PG_VERSION=9.2 PG_PORT=6432 /etc/rc.d/rc.postgresql<br><br></div><div>3.5) Initialize the new PostgreSQL cluster as suggested by README file<br></div><div><br>3.6) Stop old and new cluster<br></div><div><br>3.7) Use pg_upgrade to import your data, e.g.<br>
/usr/lib64/postgresql/9.3/bin/pg_upgrade -v -b /usr/bin -B /usr/lib64/postgresql/9.3/bin \<br> -d /var/lib/pgsql/data -D /var/lib/pgsql/9.3/data<br><br><br></div><div>Please remember that at this point, binaries in /usr/bin are still the old v9.2 binaries. When<br>
you remove old PostgreSQL package, you should create symlinks to the programs in<br>/usr/lib64/postgresql/9.3/bin directory. You could use doinst.sh script, which is copied to<br>/var/log/script/postgresql-9.3.0*<br></div>
<div>Future PostgreSQL releases (e.g. 9.4) won't have binaries, but symlinks in /usr/bin, so this<br>won't be necessary.<br><br></div><div>Any feedback on all of this and testing the SlackBuild would be warmly welcomed.<br>
</div><div><br></div><div>Best regards,<br></div><div>Adis<br></div></div>