<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Postgresql on Ayoub's Blog</title><link>https://ayoubmah.github.io/tags/postgresql/</link><description>Recent content in Postgresql on Ayoub's Blog</description><generator>Hugo</generator><language>en-us</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Thu, 20 Nov 2025 12:19:05 +0100</lastBuildDate><atom:link href="https://ayoubmah.github.io/tags/postgresql/index.xml" rel="self" type="application/rss+xml"/><item><title>Fixing Flyway Database Connection Errors in Docker</title><link>https://ayoubmah.github.io/posts/fixing-flyway-database-connection-errors-in-docker/</link><pubDate>Thu, 20 Nov 2025 12:19:05 +0100</pubDate><guid>https://ayoubmah.github.io/posts/fixing-flyway-database-connection-errors-in-docker/</guid><description>&lt;p&gt;Before reading this blog i suggest you have a quick look at how &lt;em&gt;Docker Compose starts services&lt;/em&gt; especially how databases take time to initialize before they start accepting connections.&lt;/p&gt;
&lt;p&gt;so basically, when you work with microservices, each service has its own database (in my case: patient-db, doctor-db…). and when Spring Boot starts, Flyway tries to run the migration scripts immediately.&lt;/p&gt;
&lt;p&gt;But there is a problem:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Flyway is much faster than PostgreSQL.&lt;/em&gt;&lt;br&gt;
PostgreSQL says: “I’m starting…”&lt;br&gt;
Flyway says: “I want to connect now.”&lt;br&gt;
PostgreSQL says: “Wait wait wait hold on…”&lt;br&gt;
Flyway says: “Connection refused.”&lt;/p&gt;</description></item></channel></rss>