EN
Postgres - execute SQL query from command line
9
points
In this short article, we would like to show how to execute a query on the Postgress database from the command line.
Quick solution:
echo "SELECT 1" | psql postgres://my-username:my-password@localhost:5432/my-database ON_ERROR_STOP=1 --single-transaction