Access a running docker container of the the database

Hey @Moses_Mutesasira i am trying to access the running instance of the database (postress - clinlims) using this command docker exec -it openelisglobal-database psql -U postgres and it’s perfectly doing what i expect it to do.

However my challenge on actually viewing all the tables within the database, when i execute \dt i get this as the result → Did not find any relations..

Could i be doing anything wrongly?

1 Like

(I guess i shouldn’t delete this since i have got the fix immediately after posting)

I will just go ahead and provide the solution

Apparently \dt will only list relations that are present in the default schema which is public hence the resulting Did not find any relations since public has no relations.

So i needed to SET search_path to clinlims, after that, it will list all relations present in schema clinlims.

postgres=# show search_path;
 "$user", public
(1 row)

postgres=# set search_path="clinlims";

postgres=# show search_path;

(1 row)

Hence the the tables below (in screenshot)