-
Notifications
You must be signed in to change notification settings - Fork 12
PostgreSQL DB
Wegas stores its main data in a postgres relational database.
Install a postgres container (wegas_postgres) in docker with
- a user (user),
- a database for your data (wegas_dev)
- a database for the automated tests (wegas_test)
following the wegas install procedure.
Run the command docker exec -it wegas_postgres psql -U user wegas_dev
or docker exec -it wegas_postgres psql -U user wegas_test
Now you can execute SQL or PSQL commands.
Done through the helm chart.
Run the command kubectl exec -it -n wegas <pod-name-like-wegas-psql-xxx> -- psql -U user wegas_dev
Liquibase is used to update the database structure. See the liquibase wiki page.
If you add a + after the \d[.], you will have extra information.
\d : list of tables + sequences
\d <a-table-name> : detail of the table : columns, indexes, foreign keys
\dt : list of tables
\ds : list of sequences
\di : list of indexes
\l : list of databases
\dn : list of schemas
\du : list of database roles
\db : list of tablespaces
\q or exit : quit
A command always ends with a ;
select version(); : to get the version of PostgreSQL