Forums

Postgresql tables not listing

I have a website fully running in PA using the Postgresql DB. When I open a psql console and try to list all my table, I get a bunch of administration sounding tables, my tables are not in the list! There does not appear to be a public schema either. When I run the command:

postgres=# SELECT datname from pg_database

I get a list that does indeed include my database (exercyclewatts):

postgres exercyclewatts template1 template0

But I cant query any of my tables:

postgres=# SELECT id, device_name, device_id, starttime
FROM public.exerclient_track;

I get error, with or without the 'public.' in front of the table name. There should be well over 20 tracks entries, they definitely appear on the website! What gives? How can I find an access this DB in the console?

When you start a postgres console, could you try:

\c exercyclewatts  # to connect with given database
\dt                # to list tables and confirm that `exerclient_track` is listed
select * from exerclient_track;

and see if that works?

Well that was sure simple! Thanks for the help.

Glad to hear that you made it work.