user3613919
user3613919

Reputation: 777

Pgrouting in postgres - cannot create extension

I installed postgres with EDB installer. I wanted to use pgrouting in my database. So I downloaded it through homebrew brew install pgrouting

Next, I wanted to initalize it in my database: psql mydatabase -c "create extension pgrouting;"

But I got this error ERROR: could not open extension control file "/Library/PostgreSQL/9.6/share/postgresql/extension/pgrouting.control": No such file or directory

I found pgrouting.control in /usr/local/Cellar/pgrouting/2.4.1/share/postgresql/extension/pgrouting.control

Should I just copy those files from /usr... to /Library/Postgres... ??

Upvotes: 0

Views: 2100

Answers (2)

Nikolaos Bakogiannis
Nikolaos Bakogiannis

Reputation: 35

Personally, doing the following worked for me just fine:

  • install pgrouting via homebrew
  • find all the .sql scripts related to pgrouting in the following location: /opt/homebrew/Cellar/pgrouting/HEAD-441037f/share/postgresql@14/extension
    • copy and paste all those into the path where the postgres contents area located -> /Applications/Postgres.app/Contents/Versions/14/share/postgresql/extension
  • lastly, copy the following .so file /opt/homebrew/Cellar/pgrouting/HEAD-441037f/lib/postgresql@14/libpgrouting-3.4.so into the respective location within the Postgres contents -> /Applications/Postgres.app/Contents/Versions/14/lib/postgresql

Upvotes: 1

Stephen Woodbridge
Stephen Woodbridge

Reputation: 1110

Yup that sounds like a reasonable solution.

Upvotes: 1

Related Questions