skip to Main Content

I’m using Apache age extension for PostgreSQL and I’m using PostgreSQL version 11 on my system which is Ubuntu 22.04

how I can know the version of Apache AGE using terminal in Ubuntu

4

Answers


  1. Use the following query

    SELECT extname, extversion FROM pg_extension WHERE extname = 'age';
    
    Login or Signup to reply.
  2. You can run the following command inside the terminal without getting into a sql session to list your installed extensions and their versions as well. (MUST having postgresql server running)

    # test: database name may be something else in your side
    psql -c "dx" test
    
    # output
                     List of installed extensions
      Name   | Version |   Schema   |         Description          
    ---------+---------+------------+------------------------------
     age     | 1.2.0   | ag_catalog | AGE database extension
     plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
    (2 rows)
    
    Login or Signup to reply.
  3. You can have a look at the age.control file for the version that is currently being used.

    A different version can be installed by changing the default_version property.

    default_version = '1.2.0'
    comment = 'AGE database extension'
    module_pathname = '$libdir/age'
    
    schema = 'ag_catalog'
    
    Login or Signup to reply.
    1. Connect to your PostgreSQL server using the psql command-line client and run dx age command:
    demo=# dx age
                 List of installed extensions
     Name | Version |   Schema   |      Description       
    ------+---------+------------+------------------------
     age  | 1.2.0   | ag_catalog | AGE database extension
    (1 row)
    
    
    1. You can use an SQL command to fetch the version number of the ‘age’ extension.
    demo=# SELECT extversion FROM pg_extension WHERE extname = 'age';
     extversion 
    ------------
     1.2.0
    (1 row)
    
    1. Alternatively, you can run the following directly from the command-line:
    psql -U <username> -d <database> -c "SELECT extversion FROM pg_extension 
    WHERE extname = 'age';"
    
     safi@192 postgresql-11.17 % bin/psql -U safi -d demo -c "SELECT extversion 
    FROM pg_extension WHERE extname = 'age';"
    
     extversion 
    ------------
     1.2.0
    (1 row)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search