I had similar issue, sometimes the pg directories somehow don't get created correctly so I've end up creating them manually by doing:
$ pg_ctl -D /usr/local/share/c3/postgres/data$PGDATA start
This will fail with some random logs like
2019-08-05 14:18:50.120 PDT [12307] LOG: could not open directory "pg_snapshots": No such file or directory
So you need to manually create this pg_snapshots
folder under $PGDATA
(e.g. /usr/local/share/c3/postgres/data
).
Doing this iteratively until all needed files are created solved the problem for me. Those are the files I've endup creating:
- pg_tblspc
- pg_replslot
- pg_twophase
- pg_stat
- pg_commit_ts
- pg_logical/snapshots
- pg_logical/mappings