-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SqlPgsql::dbExists checking exit code is not enough #5643
Comments
Sweetchuck
added a commit
to Sweetchuck/drush
that referenced
this issue
Jun 9, 2023
Sweetchuck
added a commit
to Sweetchuck/drush
that referenced
this issue
Jun 9, 2023
Sweetchuck
added a commit
to Sweetchuck/drush
that referenced
this issue
Jun 9, 2023
weitzman
pushed a commit
that referenced
this issue
Jun 9, 2023
weitzman
pushed a commit
that referenced
this issue
Jun 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
\Drush\Sql\SqlPgsql::dbExists()
Always returns TRUE with PostgreSQL-15.
Exit code of the command
psql --no-psqlrc -t -c "SELECT 1 AS result FROM pg_database WHERE datname='foo'"
shows that the query ran successfully.It doesn't care about the number of records.
When the database IS exists, then the stdOutput is
1\n\n
When the database IS NOT exists, then the stdOutput is
\n
. It is not an empty string, so it is converted toTRUE
.Suggested solution
Originally posted by @Sweetchuck in #5545 (comment)
The text was updated successfully, but these errors were encountered: