its very simple just reinstall your postgres again with latest version during installation stack buider for postgres open simply open tick spatial extension and click postgis bundle for postgres and download it , after download open pgadmin4 and right click database click script , remove automatically generate script and paste this CREATE EXTENSION postgis;