osx - `pg_tblspc` missing after installation of latest version of OS X (Yosemite or El Capitan) -
i use postgres homebrew in os x, when reboot system, postgres doesn't start after reboot, , manually tried start postgres -d /usr/local/var/postgres
, error occurred following message: fatal: not open directory "pg_tblspc": no such file or directory
.
the last time occurred, couldn't original state, decided uninstall whole postgres system , re-installed , created users, tables, datasets, etc... disgusting, occurs on system, once in few months.
so why lose pg_tblspc
file frequently? , there can avoid loss of file?
i haven't upgraded homebrew , postgres latest version (i.e. i've been using same version). also, things did on postgres database delete table , populate new data every day. haven't changed user, password, etc...
edit (mbannert): felt need add this, since thread top hit on google issue , many symptom different. homebrewers encounter error message:
no such file or directory server running locally , accepting connections on unix domain socket "/tmp/.s.pgsql.5432"?
so, if experienced after yosemite upgrade you're covered reading thread.
solved... in part.
apparently, installing latest versions of os x (e.g. yosemite or el capitan) removes directories in /usr/local/var/postgres
.
to fix recreate missing directories:
mkdir /usr/local/var/postgres/pg_tblspc mkdir /usr/local/var/postgres/pg_twophase mkdir /usr/local/var/postgres/pg_stat mkdir /usr/local/var/postgres/pg_stat_tmp mkdir /usr/local/var/postgres/pg_replslot mkdir /usr/local/var/postgres/pg_snapshots
or, more concisely (thanks nate):
mkdir /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots}/
rerunning pg_ctl start -d /usr/local/var/postgres
starts server and, @ least me, without data loss.
update
on system, of directories empty when postgres running. maybe, part of "cleaning" operation, yosemite removes empty directories? in case, went ahead , created '.keep' file in each directory prevent future deletion.
touch /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots}/.keep
note: creating .keep
file in directories create noise in logfile, doesn't appear negatively affect else.
Comments
Post a Comment