How to explore postgres database from outside docker

Hello and thank you for all your work!
I managed to setup localai on my macbook. After some struggling with the local file trigger it works but when the agent is trying to retrieve the content of a file i have this error:

column "content" does not exist
Failed query: SELECT string_agg(content, ' ') as document_text FROM documents_pg WHERE metadata->>'file_id' = $1 GROUP BY metadata->>'file_id';

I would like to explore the postgres database but i dont know how to setup the connection from outside docker. I tried with with:

  • host: localhost
  • port: 5432
  • user: postgres
  • password: the password from the POSTGRES_PASSWORD env variable
  • database: postgres

but it does not work.
Can someone help me?
Thanks again

Ok the problem is that db ports are not exposed.
I’ve added pgadmin inside the docker-compose:

  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin4_container
    restart: always
    ports:
      - "8888:80"
    environment:
      PGADMIN_DEFAULT_EMAIL: user-name@domain-name.com
      PGADMIN_DEFAULT_PASSWORD: strong-password

now i can connect and explore the database.

1 Like

Glad you figured it out! Also for that “content” field not found, change content to text and it’ll work. That is a glitch I have since fixed in the template!