Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Created September 23, 2022 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbietunnie/f9ead2d21db643b96a274f1905333864 to your computer and use it in GitHub Desktop.
Save barbietunnie/f9ead2d21db643b96a274f1905333864 to your computer and use it in GitHub Desktop.
How to fix `error: type "geometry" does not exist`

How to fix error: type "geometry" does not exist

The error Error: type "geometry" does not exist is sometimes encountered whilst working with Postgres databases.

You can easily fix this by following the following steps:

  1. Update your database search path.

      ALTER DATABASE <your database name> SET search_path=public,postgis;
    

    N.B: Ensure you replace <your database name> in the query above with your actual database name.

  2. Disconnect and reconnect to your database, as you the change above will not take effect in the same session.

  3. Install required extensions.

      CREATE EXTENSION fuzzystrmatch;
      CREATE EXTENSION postgis_tiger_geocoder;
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment