Skip to content

[FAQ] #103

@moharashid

Description

@moharashid

Course

data-engineering-zoomcamp

Question

How can I solve the error 'OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused'

Answer

on the ingest_script.py, we have defined the DB parameter, pg_host = localhost in our engine yet we ran the container with --pg-host=pgdatabase.

Solution: Change pg_host from localhost to pgdatabase on the ingest_script.py

Checklist

  • I have searched existing FAQs and this question is not already answered
  • The answer provides accurate, helpful information
  • I have included any relevant code examples or links

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions