\c databasename
Archive for: 月 2023’
PostgreSQL DB変更
PostgreSQL start/stop/restart(Mac)
$brew services start postgresql
$brew services stop postgresql
$brew services restart postgresql
Postgresql でユーザ作成
postgres=# create user ***_user with password '******';
CREATE ROLE
postgres=# grant all privileges on database ***_db to ***_user;
GRANT
postgres ユーザで操作する。
$ psql postgres
psql (14.8 (Homebrew))
Type "help" for help.
postgres=#
PostgreSQL の再起動(Mac)
$ brew services restart postgresql
Warning: Formula postgresql was renamed to postgresql@14.
Stopping `postgresql@14`... (might take a while)
==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14)
==> Successfully started `postgresql@14` (label: homebrew.mxcl.postgresql@14)