- lab/
geolab: PostGIS Server Manual
·1 min
Table of Contents
created: 26/09/2023
updated: 26/09/2023
start/stop PostgreSQL server #
sudo systemctl start postgresql
sudo systemctl stop postgresql
connect to server with psql #
as superadmin postgres
:
psql -h localhost -U postgres -W postgres
Password:
psql (13.4)
Type "help" for help.
postgres=#
-h
for hostname-U
for username-W
to prompt for passwordpostgres
at the end is the name of the database to connect to
psql commands #
\?
to display psql commands help\dg
tolist roles
to see other users you can login as\l
tolist databases
to see other databases you can connect to\c mydb
to connect to a database called “mydb”\dn
tolist schemas
in the current database\dt myschema.*
tolist tables
in the schema called “myschema”\dv
tolist views
update the search_path
to have \dt
list tables in your schema without specifying it:
SET search_path TO myschema, public;
SHOW search_path;