|
| 1 | +PGPRO upgarde system |
| 2 | +==================== |
| 3 | + |
| 4 | +This directory contains pgpro_upgrade script which allows to add some |
| 5 | +features (such as internal functions) into catalog of existing database. |
| 6 | + |
| 7 | +HOW TO INVOKE SCRIPT |
| 8 | +-------------------- |
| 9 | + |
| 10 | +Script is intended to be run from postinst script of installable |
| 11 | +packages. It should be invoked as database owning system user |
| 12 | +(typically, 'postgres'). |
| 13 | + |
| 14 | +Script expects that PGDATA environment variable points to database |
| 15 | +cluster to be upgraded. |
| 16 | + |
| 17 | +Script is installed into postgresql bin directory, and user can run it |
| 18 | +manually, if he has database cluster, which are not known by package |
| 19 | +configuration file. |
| 20 | + |
| 21 | +Script should be invoked when instance of PostgreSQL which is upgraded, |
| 22 | +is stopped. |
| 23 | + |
| 24 | +Script doesn't depend of any authentication settings in pg_hba.conf, |
| 25 | +because it starts postgres in single-user mode to perform upgrades. |
| 26 | + |
| 27 | +It is safe to invoke script multiple times, because it does check for |
| 28 | +features it is going to add. |
| 29 | + |
| 30 | +HOW TO ADD NEW FEATURE |
| 31 | +---------------------- |
| 32 | + |
| 33 | +You need to add two sql files in this directory, if you want to add a |
| 34 | +feature. |
| 35 | + |
| 36 | +Both files should have same base name and one — extension .test and |
| 37 | +other .sql |
| 38 | + |
| 39 | +1. Script with .sql extension contains usial create commands which would |
| 40 | +create neccessary database object(s). |
| 41 | + |
| 42 | +2. Script with .text extension should contain single select query, |
| 43 | +which returns single boolean value (i.e. one column and one row). This |
| 44 | +value should be 'f' if feature is not found in the database and should |
| 45 | +be installed, and 't' if it already exists. |
| 46 | + |