I've installed Postgres 11.3 and Timescaledb with Homebrew (macOS Mojave) but get the following error when I try to extend a database.
tutorial=# CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
ERROR: could not open extension control file "/Library/PostgreSQL/11/share/postgresql/extension/timescaledb.control": No such file or directory
Looks like the command expects Postgres to be installed in /Library, but brew info postgres says it is located in /usr/local/Cellar/postgresql/11.3. Is there a way I can modify the command so it uses the correct path?
Hey @alex-b1729,
Did you use the timescaledb_move.sh script as instructed at: https://docs.timescale.com/v1.3/getting-started/installation/macos/installation-homebrew ?
That might be the cause of the issues.
Hi @antekresic,
Yes I have been following the tutorial and used the timescaledb_move.sh script. It said it moved the files successfully.
Also, when I configured the database in the next step with timescaledb-tune I got the following, which seems to indicate it expects the file to be in /usr/local/....
```
$ timescaledb-tune
Using postgresql.conf at this path:
/usr/local/var/postgres/postgresql.conf
Is this correct? [(y)es/(n)o]: y
Writing backup to:
/var/folders/ky/dp8lgfhd3d1d2k4fy1736xj00000gn/T/timescaledb_tune.backup201906051009
success: shared_preload_libraries is set correctly
Tune memory/parallelism/WAL and other settings? [(y)es/(n)o]: y
Recommendations based on 16.00 GB of available memory and 4 CPUs for PostgreSQL 11
Memory settings recommendations
success: memory settings are already tuned
Parallelism settings recommendations
success: parallelism settings are already tuned
WAL settings recommendations
success: WAL settings are already tuned
Miscellaneous settings recommendations
success: miscellaneous settings are already tuned
Saving changes to: /usr/local/var/postgres/postgresql.conf
I believe this has nothing to do with Timescale extension, more like a Homebrew issue.
Just to be certain, I did try using the docs step by step to see if I can replicate your issue and was unable to do it.
Maybe you could try relinking postgres by doing brew unlink postgresql && brew link postgresql.
Thanks for looking into it @antekresic! I'll keep experimenting.
As a side note: I had previously installed postgreSQL through another method but am pretty sure I fully uninstalled it before installing through Homebrew.
I don't fully understand exactly what timescaledb-tune does but if I run
$ psql -U postgres -d postgres -c "SHOW config_file;" I get:
---------------------------------------------
/Library/PostgreSQL/11/data/postgresql.conf
(1 row)
Not sure if that's a result of not fully uninstalling the previous version of postgres or if it's even relevant.
Maybe I'll try uninstalling everything and starting over again.
Many thanks!
@alex-b1729 That does look like a previous version is still existing somewhere on the system, because it should be in /usr/local since that's where Homebrew installs things.
@RobAtticus you're correct. I had not fully uninstalled the previous version.
I followed instructions here, reinstalled everything through Homebrew and was able to connect to Timescaledb as expected.
Appreciate the help!
Most helpful comment
@alex-b1729 That does look like a previous version is still existing somewhere on the system, because it should be in
/usr/localsince that's where Homebrew installs things.