michelp / pgjwt

PostgreSQL implementation of JWT (JSON Web Tokens)
MIT License
364 stars 60 forks source link

Installing on Macos Catalina and Postgres 13 #20

Closed idkjs closed 3 years ago

idkjs commented 3 years ago

Given there not being any other issues asking this, I feel like this might be a dumb question.

Nevertheless, how do I install this extension on macos. I am getting the following error:

...
CREATE EXTENSION
psql:db.init/00-initial-schema.sql:10: ERROR:  could not open extension control file "/Applications/Postgres.app/Contents/Versions/13/share/postgresql/extension/pgjwt.control": No such file or directory

I have tried cloning and installing which seems to work but then when I rerun my script, i get the above error.

~/Github/test/pgjwt master
❯ make install
/bin/sh /usr/local/lib/postgresql/pgxs/src/makefiles/../../config/install-sh -c -d '/usr/local/share/postgresql/extension'
/bin/sh /usr/local/lib/postgresql/pgxs/src/makefiles/../../config/install-sh -c -d '/usr/local/share/postgresql/extension'
/usr/bin/install -c -m 644 .//pgjwt.control '/usr/local/share/postgresql/extension/'
/usr/bin/install -c -m 644 .//pgjwt--0.1.0.sql  '/usr/local/share/postgresql/extension/'

MACHINE SPECS

~/Github/test/pgjwt master                                                                                              3.0.1
❯ postgres -V
postgres (PostgreSQL) 13.3

~/Github/test/pgjwt master                                                                                              3.0.1
❯ sw_vers
ProductName:    macOS
ProductVersion: 11.5.2
BuildVersion:   20G95

Thank you, in advance, for any guidance.

idkjs commented 3 years ago

I am guessing it I need to change the install directory based on this output:

❯ psql -d profiles_db -U profiles_admin 
psql (13.3)
Type "help" for help.

profiles_db=# create extension pgjwt
profiles_db-# ;
ERROR:  could not open extension control file "/Applications/Postgres.app/Contents/Versions/13/share/postgresql/extension/pgjwt.control": No such file or directory

Adding this to my fish.config seems to have done the trick.

# Add `pg_config` to path
# https://fishshell.com/docs/current/tutorial.html?highlight=fish_user_path#path
set PG_CONFIG /Applications/Postgres.app/Contents/Versions/latest/bin
fish_add_path $PG_CONFIG

Closing for now. Leaving here for other similarly situated people.

Thank you.