我对PostrgreSQL非常陌生,我遇到了一个我不知道如何解决的问题。
我目前正在为OSX使用PostreSQL 10应用程序;我正在尝试使用rails db:drop db:create db:migrate重新创建一个Rails应用程序数据库。我得到以下错误:
PG::ObjectInUse: ERROR: database "app_development" is being accessed by other users另一个会话是Postgres应用程序保持连接打开:如果我运行ps -ef | grep postgres,我将得到
502 38332 1 0 2:57PM ?? 0:00.15 /Applications/Postgres.app/Contents/Versions/10/bin/postgres -D /Users/user/Library/Application Support/Postgres/var-10 -p 5432
502 38334 38332 0 2:57PM ?? 0:00.01 postgres: checkpointer process
502 38335 38332 0 2:57PM ?? 0:00.07 postgres: writer process
502 38336 38332 0 2:57PM ?? 0:00.02 postgres: wal writer process
502 38337 38332 0 2:57PM ?? 0:00.04 postgres: autovacuum launcher process
502 38338 38332 0 2:57PM ?? 0:00.17 postgres: stats collector process
502 38339 38332 0 2:57PM ?? 0:00.01 postgres: bgworker: logical replication launcher
502 38342 38332 0 2:57PM ?? 0:00.21 postgres: user app_development [local] idle
502 38661 38432 0 3:06PM ttys004 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn postgres我不能仅仅停止Postgres应用程序,然后运行rails db:drop命令,因为这样我就会得到以下错误:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?我怎样才能真正重新创建我的数据库?提前感谢
发布于 2018-07-04 13:49:08
尝试重新启动它,brew services restart postgresql
https://stackoverflow.com/questions/51174717
复制相似问题