When we issue CREATE EXTENSION postgis on our PostgreSQL database, the extension created is the one of which we have the appropriate files of in our PostgreSQL server configuration.

Well, is it possible to create a situation in which we can install both postgis 2.3 and postgis 2.4 extensions for example? Maybe we can't have both extensions active at the same but perhaps we can still switch between 2 versions effortlessly, such as issuing some kind of CREATE EXTENSION postgis2.3 and CREATE EXTENSION postgis2.4 command? I am sure developers could use this to see if a PostGIS feature of a particular version is also functioning the same on another version as an example.


You can not in the same database, but you can in different databases in the same cluster (Postgres server instance).

What I think you are asking (in same database) is not something we would care to do as it isn't supported in PostgreSQL and even if we could figure out a way, it would be an immense amount of work for little benefit.

To install different versions in same cluster but different dbs, you do these basic steps.

1) Install both PostGIS 2.2 and 2.3 binaries in the cluster. Note that most packagers usually carry just one version, so you may have to compile yourself depending on OS.

2) Once you have both installed in same cluster,you just need to specify the version number in database.

For PostGIS 2.2 command would be like or whatever version you installed.


For PostGIS 2.3

  • I was more interested on different databases in the same cluster. How can I go about doing that? Feb 20 '17 at 1:53
  • Basic is you install both PostGIS version binaries.. I'll update my answer
    – LR1234567
    Feb 22 '17 at 15:35
  • 1
    Had no idea that was possible. That's pretty cool! Thanks. Feb 26 '17 at 19:40
  • Now if I am developing my own variation of the extension, which file would I need to change to install it i.e. to perform CREATE EXTENSION postgis VERSION "2.3dev"? Feb 26 '17 at 19:53
  • Nevermind: can answer my own question on this: I just need to modify the control file. Thanks again! Feb 26 '17 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.