| -- -------------------------------------- |
| -- catversion |
| -- -------------------------------------- |
| -- ********************************************************************* |
| -- ********************************************************************* |
| -- This script will produce diffs if you add or change catalog version |
| -- in src/include/catalog/catversion.h. If you want to change the results, |
| -- you must make the changes in regress/output/catversion.source, not |
| -- regress/expected, and use gpsourcify.pl to generate a ".out" file. |
| -- |
| -- From the regress directory invoke the command: |
| -- |
| -- gpsourcify.pl results/catversion.out > output/catversion.source |
| -- |
| -- ********************************************************************* |
| -- ********************************************************************* |
| -- ********************************************************************* |
| -- ********************************************************************* |
| CREATE EXTERNAL WEB TABLE get_pgvsn (x text) |
| execute E'(postgres --catalog-version | sed \'s/Catalog version number://g \' | sed -e \'s/ //g\' )' |
| ON MASTER |
| FORMAT 'text' (delimiter '|'); |
| CREATE EXTERNAL WEB TABLE get_jvsn (x text) |
| execute E'(python -c \'import os; import json; from gppylib.gpversion import GpVersion; vsn = GpVersion("main") ; jname = str(vsn.getVersionRelease()) + ".json" ; infil = open(os.path.join("@abs_srcdir@/../../../../tools/bin/gppylib/data", jname)); d = json.load(infil); print d["__info"]["CATALOG_VERSION_NO"] \')' |
| ON MASTER |
| FORMAT 'text' (delimiter '|'); |
| -- start_equiv |
| select 'version', * from get_jvsn; |
| ?column? | x |
| ----------+----------- |
| version | 201107201 |
| (1 row) |
| |
| select 'version', * from get_pgvsn; |
| ?column? | x |
| ----------+----------- |
| version | 201107201 |
| (1 row) |
| |
| -- end_equiv |
| drop external table get_pgvsn; |
| drop external table get_jvsn; |