How do I install with PostgreSQL using Docksal? I use Docksal for developing on Drupal. Recently, I decided to install Drupal 9 with PostgreSQL as a database using Docksal.
Firstly, I cloned https://github.com/docksal/boilerplate-drupal9. Then, I modified some files accordingly to https://github.com/docksal/docksal/issues/193#issuecomment-376343111. Lastly, I ran fin init and this error message.

[warning] Failed to drop or create the database. Do it yourself before installing.
ERROR 2002 (HY000): Can't connect to MySQL server on 'db' (115)
[notice] Starting Drupal installation. This takes a while.

Frankly speaking, I can't understand what does MySQL has to do with it?
The database driver should be PostgreSQL and the default database should be also PostgreSQL.
Has anybody encountered this problem?
Is it possible to install Drupal 9 on PostgreSQL via the Docksal service?
It should be noted that you need postgres 10+ when using Drupal 9.
The steps that you are following in are for Drupal 8 and they will install postgres 9.
Recently a services has been added to Docksal that installs a postgres database that matches your Drupal version (8 or 9).
See the Docksal documentation on adding a postgres service.
Add this service and outcomment the default db image in docksal.env:
#DB_IMAGE='docksal/mysql:5.7-1.4'

When this services is added check that it works correctly by checking the docksal status:
~/S/mysite ❯❯❯ fin status
   Name                  Command                 State                         Ports                   
-------------------------------------------------------------------------------------------------------
d9geo_cli_1   /opt/startup.sh supervisord     Up (healthy)   22/tcp, 3000/tcp, 9000/tcp                
d9geo_db_1    docker-entrypoint.sh postgres   Up             0.0.0.0:49174-&gt;5432/tcp,:::49174-&gt;5432/tcp
d9geo_web_1   httpd-foreground                Up (healthy)   443/tcp, 80/tcp                           

Your Drupal settings should look as follows (note that the driver should be pgsql)
$databases['default']['default'] = [
    'database' =&gt; 'default',
    'username' =&gt; 'user',
    'password' =&gt; 'user',
    'host' =&gt; 'db',
    'driver' =&gt; 'pgsql',
];

User, password etc. can be changed using environment variables.
Now you should be able to install the website.