skip to Main Content

I have multiple versions of PostgreSQL installed in my ubuntu version 18.04 and my extensions are saved in Postgresql version 12 but when I run:

sudo -u postgres psql

command to enter Postgres and creating extensions by entering command

create extension addme;

It is showing me error of not created extension(addme.control and addme–0.0.1.sql) in version 10 but it is in version 12.

Error Image

Can anyone tell me how to access version 12 in which I can access those extensions.

Thank You.

2

Answers


  1. When working with multiple versions, I have configuredinstalled Postgres in separate directory for particular version. How is your configuration look like?

    Login or Signup to reply.
  2. so simply just try to go to the version(12) manually you need to perform the following in order

    1. stop the current server of the PostgreSQL (default 10)
    2. find out where the desired version of PostgreSQL is installed
    3. start the server manually
    /usr/local/pgsql-12/bin/pg_ctl -D /usr/local/pgsql-12/data start
    
    1. now you are able to connect to the database using that version and you can see the extension you created besides you can use export as an alternative way by setting up the PG_Version to the PostgreSQL12 path.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search