Open ryansabir opened 4 months ago
Describe the bug src/Sql/SqlPgsql.php line 47 is: return 'psql -q ON_ERROR_STOP=1 ';
This is the wrong syntax. The ON_ERROR_STOP is being ignored, you can see this if you remove the '-q' option.
To Reproduce Execute any drush sql command, e.g.: drush -v --debug sql-query "SELECT 1"
Now look at the SQL generated with the label 'Executing': Executing: psql -q ON_ERROR_STOP=1 --dbname=etc...
Expected behavior The sql generated should be: psql -q --set ON_ERROR_STOP=1
Actual behavior This causes an error on Windows when running any drush sql command. On MacOS (and presumably Linux) the variable is ignored.
Workaround Changing line 47 of src/Sql/SqlPgsql.php: return 'psql -q ON_ERROR_STOP=1 '; to return 'psql -q --set ON_ERROR_STOP=1 ';
Fixes it temporarily.
Additional information This code was added as a fix for #5650. Tagging @weitzman .
Hey @ryansabir i would like to work on this issue, you can assign it to me. Thank you!!
Describe the bug src/Sql/SqlPgsql.php line 47 is: return 'psql -q ON_ERROR_STOP=1 ';
This is the wrong syntax. The ON_ERROR_STOP is being ignored, you can see this if you remove the '-q' option.
To Reproduce Execute any drush sql command, e.g.: drush -v --debug sql-query "SELECT 1"
Now look at the SQL generated with the label 'Executing': Executing: psql -q ON_ERROR_STOP=1 --dbname=etc...
Expected behavior The sql generated should be: psql -q --set ON_ERROR_STOP=1
Actual behavior This causes an error on Windows when running any drush sql command. On MacOS (and presumably Linux) the variable is ignored.
Workaround Changing line 47 of src/Sql/SqlPgsql.php: return 'psql -q ON_ERROR_STOP=1 '; to return 'psql -q --set ON_ERROR_STOP=1 ';
Fixes it temporarily.
System Configuration
Additional information This code was added as a fix for #5650. Tagging @weitzman .