Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello everyone,

I'm a newbie of symfony and I'm reading the book. In stuck here

https://symfony.com/doc/current/the-fast-track/en/7-database.html

When i use the command "symfony run psql" i receive this error

"exec: "psql": executable file not found in %PATH%"

How can i solve?

You must be logged in to vote

Replies: 2 comments · 7 replies

Comment options

You can run symfony run psql only if you have psql installed localy. See section https://symfony.com/doc/current/the-fast-track/en/7-database.html#accessing-the-local-database

You must be logged in to vote
6 replies
@ghost
Comment options

It's a warning but it looks like your connected to the database container app=#

@claudioaddobbati
Comment options

Thank you su much for the help but...what i have to do now? I'm stuck in app-# and i can't send any command like "symfony console make:entity Conference". Sorry i'm very bad

@ghost
Comment options

you're inside postgres container. I can't explain what docker containers are because this topic is to wide. Symfony binary only works from you host so you have to exit the container or open a new terminal tab.

@stof
Comment options

stof Jun 7, 2023
Collaborator

symfony run psql runs the postgres shell, to allow you to run SQL queries. You need to stop it (with Ctrl+C) to exit from it.

@ghost
Comment options

Right, it opens the postgres shell. Sorry for mixing things and the container stuff (too much docker in my life 😄).

Comment options

On Ubuntu, I installed the psql binary by installing the PostgreSQL client package:

sudo apt install postgresql-client
You must be logged in to vote
1 reply
@geoffreyvanwyk
Comment options

On Ubuntu 22.04, I got PostgreSQL client 14, while the version in Docker is 15. When running symfony run psql, there was a warning about the version mismatch and that some functionality of psql might not work.

Command symfony run pg_dump totally failed with an error due to the version mismatch.

To install PostgreSQL client 15, I had to follow these steps:

sudo apt remove postgresql-client-14
sudo mkdir /etc/apt/keyrings
sudo wget --output-document /etc/apt/keyrings/postgresql.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/postgresql.asc] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main' | sudo tee -a /etc/apt/sources.list.d/apt_postgresql_org_pub_repos_apt.list > /dev/null
sudo apt update
sudo apt install postgresql-client-15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.