0

I need to connect to a postgres database and view the contents of one of the tables. No problem to connect, I do it this way

sudo docker-compose exec db psql -p 5432 -d gpanel_db -U db_root

where

db - service name in docker-compose file

gpanel_db - DB name

db_root - DB user

Connecting to DB

use gpanel_db

Show tables

gpanel_db=# \dt

                          List of relations
 Schema |                   Name                   | Type  |  Owner  
--------+------------------------------------------+-------+---------
 public | auth_group                               | table | db_root
 public | auth_group_permissions                   | table | db_root
 public | auth_permission                          | table | db_root
 public | auth_user                                | table | db_root
 public | auth_user_groups                         | table | db_root
 public | auth_user_user_permissions               | table | db_root
 public | creative_performer_creativecategory      | table | db_root
 public | creative_performer_creativestatushistory | table | db_root
 public | creative_performer_creativetag           | table | db_root
 public | creative_performer_creativetype          | table | db_root
 public | creative_performer_googlecreative        | table | db_root
 public | creative_performer_googlecreativespend   | table | db_root
 public | creative_performer_playablecreativesize  | table | db_root
 public | creative_performer_tag                   | table | db_root
 public | creative_performer_videocreativeduration | table | db_root
 public | django_admin_log                         | table | db_root
 public | django_content_type                      | table | db_root
 public | django_migrations                        | table | db_root
 public | django_session                           | table | db_root
 public | django_site                              | table | db_root

But select name from auth_group return nothing, just starts a new line

Same behaviour for several other tables I have queried

Jekson
  • 2,892
  • 8
  • 44
  • 79
  • 1
    https://stackoverflow.com/questions/12472026/in-psql-why-do-some-commands-have-no-effect –  Aug 26 '22 at 11:23

1 Answers1

0

You are missing semicolon ";" at the end of the instruction.

Lorenzo Prodon
  • 343
  • 1
  • 8