Skip to content

Database

Alexandre Bevington edited this page Apr 2, 2024 · 2 revisions

Postgres

[root@localhost data]# which psql
/usr/bin/psql
[root@localhost /]# find / -name psql
/usr/edb/as11/bin/psql

Connect to db:

psql -h localhost -p 5432 -d omineca_hydro -U USERNAME

List tables:

\dt

List tables with details:

\dt+

List tables with details:

\d table_name
\d+ table_name

Replace values:

UPDATE app_schema.stage_mm 
  SET stage_mm = NULL
  WHERE site_id = 1 AND stage_mm > 2000;

Clone this wiki locally