Closed anmol26s closed 5 years ago
I worked around that one in Discourse: https://github.com/YunoHost-Apps/discourse_ynh/blob/master/scripts/install#L89-L90 :
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
Yet that should be changed to be analogous with the MySQL helper.
@JimboJoe Thanks This worked. I agree we should fix the psql command. Maybe @Jibec and @maniackcrudelis can have a look at it?
I'm unsure all commands needs a database, but I'm fine if you fix this either by telling how to select the db if relevant or by adding the $db parameter.
Btw, this helper is now part of core, but there were no public announce because of lack of enough testing (this is quite an important helper): https://github.com/YunoHost/yunohost/blob/stretch-unstable/data/helpers.d/psql
ynh_psql_execute_as_root is now an official helper and include a database argument ynh_psql_execute_as_root --sql=sql [--database=database]
Issue can be closed ^^
Thanks for the information. Closing this.
Hi The ynh_psql_execute_as_root is missing db name in the command. see https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/postgres/postgres#L71
Because of this I can not create an extension for a specific database. So
ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS unaccent;" "$db_name"
don't work for peertube.