sudo service postgresql start
sudo service postgresql restart
# To restart the postgresql service
sudo /etc/init.d/postgresql restart
sudo systemctl restart postgresql-13.service
ALTER SEQUENCE <tablename>_<id>_seq RESTART WITH 1
pg_ctl -D "C:Program FilesPostgreSQL12data" restartCode language: JavaScript (javascript)
#for windows:
Press Windows key + R, ‘RUN’ box will appear.
Type services.msc in the Run box and hit enter.
Services window will open, search for postgresql-13. Here 13 is the version of PostgreSQL installed in the window machine.
Right-click on the postgresql-13 and click on the restart option.
The services will restart now.
This is how we can restart PostgreSQL services in windows machines.
#source: https://sqlserverguides.com/restart-postgres/
ALTER SEQUENCE users_id_seq RESTART WITH 1