Ganos is a spatio-temporal database engine that is developed by Alibaba Cloud. Ganos provides a wide range of data types, functions, and stored procedures. This topic describes how to update the Ganos plug-ins on an ApsaraDB RDS instance.

Each Ganos plug-in is identified by the word Ganos in the description of the Ganos plug-in. To find and update the Ganos plug-ins that you installed, perform the following steps:
  1. Use the PostgreSQL CLI to connect to your RDS instance.
  2. Run the \dx command to view all plug-ins that you installed.
    Information similar to the following command output is displayed:
                                                                              List of installed extensions
                    Name                | Version |   Schema   |                                                     Description
    ------------------------------------+---------+------------+---------------------------------------------------------------------------------------------------------------------
     address_standardizer               | 2.5.4   | public     | Ganos PostGIS+ address standardizer
     address_standardizer_data_us       | 2.5.4   | public     | Ganos PostGIS+ address standardizer data us
     ganos_address_standardizer         | 4.1     | public     | Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.
     ganos_address_standardizer_data_us | 4.1     | public     | Address Standardizer US dataset example
     ganos_geometry                     | 4.1     | public     | Ganos geometry extension for PostgreSQL
     ganos_geometry_sfcgal              | 4.1     | public     | Ganos geometry SFCGAL functions extension for PostgreSQL
     ganos_geometry_topology            | 4.1     | topology   | Ganos geometry topology spatial types and functions extension for PostgreSQL
     ganos_networking                   | 4.1     | public     | Ganos networking extension for PostgreSQL
     ganos_spatialref                   | 4.1     | public     | Ganos spatial reference extension for PostgreSQL
     ganos_tiger_geocoder               | 4.1     | tiger      | Ganos tiger geocoder and reverse geocoder
     plpgsql                            | 1.0     | pg_catalog | PL/pgSQL procedural language
     postgis                            | 2.5.4   | public     | Ganos PostGIS+
     postgis_sfcgal                     | 2.5.4   | public     | Ganos PostGIS+
     postgis_tiger_geocoder             | 2.5.4   | public     | Ganos PostGIS+ tiger geocoder
     postgis_topology                   | 2.5.4   | public     | Ganos PostGIS+ topology
                            
  3. View the information about each plug-in in the Description column of the command output to find the Ganos plug-ins that you want to update.
    Note If the description of a plug-in includes the word Ganos, the plug-in is a Ganos plug-in.
  4. Update the Ganos plug-ins.
    • If the Ganos plug-ins are in version 3.1 or later, execute the following statement to update all Ganos plug-ins:
      SELECT ganos_update();
    • If the Ganos plug-ins are in versions earlier than 3.1, create a function to update all Ganos plug-ins. The following code snippet is an example:
      CREATE OR REPLACE FUNCTION ganos_update()
          RETURNS text AS
      $$
      DECLARE
          rec RECORD;
          sql text;
      BEGIN
          FOR rec IN
              SELECT extname
              FROM pg_extension
              WHERE extname like 'ganos_%'
              LOOP
                  sql = 'ALTER EXTENSION '
                      || rec.extname
                      || ' UPDATE ';
                  RAISE NOTICE '%', sql;
                  EXECUTE sql;
      
              END LOOP;
      
          return 'All Ganos extensions have updated to latest version';
      
      END
      $$ LANGUAGE 'plpgsql' volatile STRICT;
    Note The method of updating the Ganos plug-ins is different from the method of updating other plug-ins. To update a different plug-in, you can execute the following statement:
    ALTER EXTENSION <Plug-in name> UPDATE;