diff --git a/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java b/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java
index bc276f4cc1b..27b3679b626 100644
--- a/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java
+++ b/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java
@@ -11,7 +11,7 @@
/**
* Testcontainers implementation for PostgreSQL.
*
- * Supported image: {@code postgres}
+ * Supported images: {@code postgres}, {@code pgvector/pgvector}
*
* Exposed ports: 5432
*/
@@ -25,6 +25,8 @@ public class PostgreSQLContainer> extends
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("postgres");
+ private static final DockerImageName PGVECTOR_IMAGE_NAME = DockerImageName.parse("pgvector/pgvector");
+
public static final Integer POSTGRESQL_PORT = 5432;
static final String DEFAULT_USER = "test";
@@ -53,7 +55,7 @@ public PostgreSQLContainer(final String dockerImageName) {
public PostgreSQLContainer(final DockerImageName dockerImageName) {
super(dockerImageName);
- dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
+ dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, PGVECTOR_IMAGE_NAME);
this.waitStrategy =
new LogMessageWaitStrategy()
diff --git a/modules/postgresql/src/test/java/org/testcontainers/containers/CompatibleImageTest.java b/modules/postgresql/src/test/java/org/testcontainers/containers/CompatibleImageTest.java
index 2bb1c6c3d54..76b4a8c1bda 100644
--- a/modules/postgresql/src/test/java/org/testcontainers/containers/CompatibleImageTest.java
+++ b/modules/postgresql/src/test/java/org/testcontainers/containers/CompatibleImageTest.java
@@ -15,9 +15,7 @@ public class CompatibleImageTest extends AbstractContainerDatabaseTest {
public void pgvector() throws SQLException {
try (
// pgvectorContainer {
- PostgreSQLContainer> pgvector = new PostgreSQLContainer<>(
- DockerImageName.parse("pgvector/pgvector:pg16").asCompatibleSubstituteFor("postgres")
- )
+ PostgreSQLContainer> pgvector = new PostgreSQLContainer<>("pgvector/pgvector:pg16")
// }
) {
pgvector.start();