PostgreSQL could not open extension control file “C:/../share/extension/postgis.control”:

ERROR:  could not open extension control file "C:/Program Files/PostgreSQL/10/share/extension/postgis.control": No such file or directory

Actual Cause: If you installed postgres <= 10.1 and want to create postgis extension using `CREATE EXTENSION postgis`you may get this issue. 

Solution: 

It seems that the case is still the same with latest versions of postgres (PostgreSQL-9.6.3-1-win64-bigsql.exe) and postgis (postgis-bundle-pg96x64-setup-2.3.2-1.exe). I copied the files around until all the paths could be resolved:

    Everything from C:\PostgreSQL\pg96\share\extension to C:\PostgreSQL\pg96\share\postgresql\extension
    postgis_topology-2.3.dll, postgis-2.3.dll, rtpostgis-2.3.dll, address_standardizer-2.3.dll and ogr_fdw.dll from C:\PostgreSQL\pg96\lib to C:\PostgreSQL\pg96\lib\postgresql


Ref: https://stackoverflow.com/questions/42806784/how-to-alter-the-path-for-postgres-looking-for-extensions