Debugging PostgreSQL database issues
If you face issues related to the PostgreSQL database, you must first log in to the database. Complete the following steps to log in to the PostgreSQL database:
Run the following command:
kubectl get pods -n <namespace> | grep client
ade-infra-clients-7d97787dcc-mvtfb 1/1 Running 0 22m
kubectl exec -it ade-infra-clients-7d97787dcc-mvtfb bash -n <namespace>
PGPASSWORD=pGTest2020 psql -h postgres-postgresql-ha-postgresql -p 5432 -U postgres -d postgres
select schema_name from information_schema.schemata;
select * from tdc_integration_645531793.tenant;You can determine whether the PostgreSQL container is in the master or standby node. Run the following command:
postgres=# select pg_is_in_recovery();
pg_is_in_recovery
-------------------
f
(1 row)
f = false, the node is the master node
t = true, the node is running in standby mode