Testing:
In the previous article we learned how to install PostgreSQL and age from source. Part 1 here.
Creating and testing of database cluster.
Database initialization:
Now we will initialize our database cluster.
cd postgresql-12.0
which psql
ls /usr/local/pgsql/bin/
export PATH=/usr/local/pgsql/bin/:$PATH
export PGDATA=/usr/local/pgsql/bin/data
sudo chown -R moiz /usr/local/pgsql/
To initialize a database in a PostgreSQL database cluster, you can use the initdb command. This command creates the necessary directories and files for a new database cluster.
Here's the syntax:
initdb --username=<database superuser name> [other options] <database cluster location>
For example:
initdb
When you will execute the command the success message will be shown with the command to start the server.
Starting Server:-
pg_ctl start -l log
Checking Server Status:-
pg_ctl status -l log
Postgres :-
The command psql postgres is used to connect to a PostgreSQL database named "postgres". psql is a command-line interface to the PostgreSQL database system. When you run the psql postgres command, you will be logged in to the "postgres" database as the current operating system user.
psql postgres
Apache-Age:-https://age.apache.org/
GitHub:-https://github.com/apache/age
Top comments (0)