Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add on_error_stop to postgres driver. Fixes #5591 #5650

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

weitzman
Copy link
Member

No description provided.

@weitzman weitzman merged commit 2315f1f into drush-ops:12.x Jun 12, 2023
2 checks passed
@jdegave
Copy link

jdegave commented Apr 19, 2024

Hi,
On postgreSQL 16.2, the psql command needs the -v general options in order to set ON_ERRO_STOP=1; failing to do so will result in an error and prevent drush si to succeed :

> psql -V
psql (PostgreSQL) 16.2
> psql -q ON_ERROR_STOP=1  --dbname=template1 --host=localhost --port=5432 --username=XXX --no-align --field-separator="      " --pset tuples_only=on -t -c "SELECT 1 AS result FROM pg_database WHERE datname='XXX'"
psql: error: invalid connection option "ON_ERROR_STOP"
> psql --help
...
General options:
  -c, --command=COMMAND    run only single command (SQL or internal) and exit
  -d, --dbname=DBNAME      database name to connect to (default: "postgres")
  -f, --file=FILENAME      execute commands from file, then exit
  -l, --list               list available databases, then exit
  -v, --set=, --variable=NAME=VALUE
                           set psql variable NAME to VALUE
                           (e.g., -v ON_ERROR_STOP=1)
...
> psql -q -v ON_ERROR_STOP=1  --dbname=template1 --host=localhost --port=5432 --username=afp --no-align --field-separator="      " --pset tuples_only=on -t -c "SELECT 1 AS result FROM pg_database WHERE datname='afpdb'"
Password for user XXX:

1

I'm using Drupal 10.2.3, Drush 12.4.3.0, PHP 8.3.6, Apache 2.4.59, PostgreSQL 16.2, PowerShell 7.2.4, Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants