PostgreSQL - ArchWiki - Arch Linux
https://wiki.archlinux.org/title/PostgreSQLFamiliarize with PostgreSQL Access the database shell. Become the postgres user. Start the primary database shell, psql, where you can do all your creation of databases/tables, deletion, set permissions, and run raw SQL commands.Use the -d option to connect to the database you created (without specifying a database, psql will try to access a database that matches your …
PostgreSQL (简体中文) - ArchWiki
wiki.archlinux.org › title › PostgreSQL_(简体中文)Become the postgres user(change to root, then postgres user), and initialize the new cluster: initdb -D /pathto/pgroot/data If not using systemd, edit /etc/conf.d/postgresql and change the PGROOT variable(optionally PGLOG) to point to your new pgroot directory: #PGROOT="/var/lib/postgres/" PGROOT="/pathto/pgroot/"
PostgreSQL - ArchWiki - Arch Linux
wiki.archlinux.org › title › PostgreSQLNote: Commands that should be run as the postgres user are prefixed by [postgres]$ in this article. You can switch to the PostgreSQL user by executing the following command: If you have sudo and are in sudoers: $ sudo -iu postgres. Otherwise using su: $ su # su -l postgres. See sudo (8) or su (1) for their usage.