Installing Tanzu Postgres Extensions

This topic covers installation steps for the extensions packaged with Tanzu Postgres 1.2 and later. The extensions include:

Refer to the linked extension documentation for instructions on using the extensions.

Orafce

Orafce is packaged with the Postgres instance images. It needs to be manually installed on the primary data pod:

  1. Connect to the primary pod via psql and use:

    =# CREATE EXTENSION orafce;
    
  2. To verify the installation:

    =# SELECT months_between(date '1995-02-02', date '1995-01-01');
    

    The output should be similar to:

    months_between
    ------------------
    1.03225806451613
    (1 row)
    

For more information, refer to the Orafce documention.

PostGIS

PostGIS is packaged with the Postgres instance images. It needs to be manually installed on the primary data pod:

  1. Connect to the primary pod via psql and use:

    =# CREATE EXTENSION postgis;
    
  2. To verify the installation:

    =# SELECT st_pointfromtext('POINT(1 1)');
    

    The output should be similar to:

    st_pointfromtext
    --------------------------------------------
    0101000000000000000000F03F000000000000F03F
    (1 row)
    

    For more information refer to the PostGIS documentation.

Address Standardizer

  1. Connect to the primary pod via psql and use:

    =# CREATE EXTENSION address_standardizer;
    
  2. To verify the installation:

    =# SELECT num, street, city, state, zip FROM parse_address('1 Devonshire Place PH301, Boston, MA 02109');
    

    You should see output similar to:

    num |         street         |  city  | state |  zip
    -----+------------------------+--------+-------+-------
    1   | Devonshire Place PH301 | Boston | MA    | 02109
    (1 row)
    

For more information refer to the Address Standardizer documentation.

PL/Java

PL/Java is currently in Beta and not under official support.

PL/Java and JVM is packaged with the Postgres instance images. Manually install the extensions on the primary data pod:

  1. Connect to the primary pod via psql and use:

    #= CREATE EXTENSION PLJAVA;
    
  2. To verify the installation, run the following in the same psql session:

    1. Install the example pljava jar, included on the postgres instance

      #= SELECT sqlj.install_jar('file:///usr/share/postgresql/pljava/pljava-examples-1.5.7.jar', 'examples', true);
      
    2. Set the classpath:

      #= SELECT sqlj.set_classpath('javatest', 'examples');
      
    3. Run a test function:

       #= SELECT javatest.java_addone(1);
    

    The output should be similar to:

       java_addone
       -------------
                2
       (1 row)
    

For more information refer to the PL/Java documentation.