# Installing postgresql via Brew: "/usr/local/var/postgresql@11" does not exist

**URL:** <https://discuss.circleci.com/t/installing-postgresql-via-brew-usr-local-var-postgresql-11-does-not-exist/35129>\
**Category:** Mobile\
**Tags:** ios, circle-yml\
**Created:** [March 25, 2020, 8:12pm UTC](https://discuss.circleci.com/t/installing-postgresql-via-brew-usr-local-var-postgresql-11-does-not-exist/35129 "2020-03-25T20:12:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickvallee](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nickvallee/32/24457_2.png) [@nickvallee](https://discuss.circleci.com/u/nickvallee)\
**Post date:** [March 25, 2020, 8:12pm UTC](https://discuss.circleci.com/t/installing-postgresql-via-brew-usr-local-var-postgresql-11-does-not-exist/35129/1 "2020-03-25T20:12:39Z")

</div>

Hi, I am running into a problem with setting up postgresql for running e2e tests for a mobile application.  
I am installing postresql VIA homebrew in my `config.yml` file. I receive the following error:

```auto
#!/bin/bash --login -eo pipefail
pg_ctl -D /usr/local/var/postgresql@11 -l /usr/local/var/postgresql@11/server.log start
pg_ctl: directory "/usr/local/var/postgresql@11" does not exist
Exited with code exit status 1

```

I have tried removing the version entirely and using postgresql@12 instead, but the error persists. I checked the homebrew available versions, and I checked the available version for circle ci.

Here is the related code in the config.yml file:

```auto
start_postgres: &start_postgres
  run:
    name: Start postgresql
    command: pg_ctl -D /usr/local/var/postgresql@11 -l /usr/local/var/postgresql@11/server.log start

homebrews: &homebrews
  run:
    name: Install homebrew dependencies
    command: |
      brew update
      HOMEBREW_NO_AUTO_UPDATE=1 brew bundle
      echo 'export PATH="/usr/local/opt/postgresql@11/bin:$PATH"' >> ~/.bash_profile
      source ~/.bash_profile

```

So far, I found no related issues in my searches. Please let me know if you can direct me in any way!

Just to add: this had been working previously.

---

<div class="post-metadata">

**Author:** ![bytesguy](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bytesguy](https://discuss.circleci.com/u/bytesguy)\
**Post date:** [April 16, 2020, 12:23pm UTC](https://discuss.circleci.com/t/installing-postgresql-via-brew-usr-local-var-postgresql-11-does-not-exist/35129/2 "2020-04-16T12:23:32Z")

</div>

@nickvallee 👋

Homebrew normal stores things in `/usr/local/opt/` - could you try this instead of `/usr/local/var`?
