Postgres DBA · Lesson 7

Start,Stop and check the status of postgresql server

-> After the initilizing the data directory we need to start the server. Default port is 5432. To start the server: Go to the installation directory then give the data directory location then start using the cmd. cmd:/usr/local/pgsql/bin/pg_ctl -D /DB/postgres9.5.8/ start To…

connected · blinksql_demo

-> After the initilizing the data directory we need to start the server. Default port is 5432.
To start the server:

Go to the installation directory then give the data directory location then start using the cmd.
cmd:/usr/local/pgsql/bin/pg_ctl -D /DB/postgres9.5.8/ start
to start the server

To check the server status whether its running or not:
cmd:/usr/local/pgsql/bin/pg_ctl -D /DB/postgres9.5.8/ status

to check the server status

To stop the server:

cmd:/usr/local/pgsql/bin/pg_ctl -D /DB/postgres9.5.8/ -m fast stop
to stop the server

-> Now we can connect to the server and create our own database through PGAdmin tool or from the cmd itself.

Practice — AI-generated for this lesson

Write a query that shows each order status and how many orders have it — but only statuses with more than 1 order.