Commit 833249d 1 parent d8027dc commit 833249d Copy full SHA for 833249d
File tree 2 files changed +5
-5
lines changed
main/java/org/testcontainers/containers
test/java/org/testcontainers/containers
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11
11
/**
12
12
* Testcontainers implementation for PostgreSQL.
13
13
* <p>
14
- * Supported image : {@code postgres}
14
+ * Supported images : {@code postgres}, {@code pgvector/pgvector }
15
15
* <p>
16
16
* Exposed ports: 5432
17
17
*/
@@ -25,6 +25,8 @@ public class PostgreSQLContainer<SELF extends PostgreSQLContainer<SELF>> extends
25
25
26
26
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName .parse ("postgres" );
27
27
28
+ private static final DockerImageName PGVECTOR_IMAGE_NAME = DockerImageName .parse ("pgvector/pgvector" );
29
+
28
30
public static final Integer POSTGRESQL_PORT = 5432 ;
29
31
30
32
static final String DEFAULT_USER = "test" ;
@@ -53,7 +55,7 @@ public PostgreSQLContainer(final String dockerImageName) {
53
55
54
56
public PostgreSQLContainer (final DockerImageName dockerImageName ) {
55
57
super (dockerImageName );
56
- dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
58
+ dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME , PGVECTOR_IMAGE_NAME );
57
59
58
60
this .waitStrategy =
59
61
new LogMessageWaitStrategy ()
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ public class CompatibleImageTest extends AbstractContainerDatabaseTest {
15
15
public void pgvector () throws SQLException {
16
16
try (
17
17
// pgvectorContainer {
18
- PostgreSQLContainer <?> pgvector = new PostgreSQLContainer <>(
19
- DockerImageName .parse ("pgvector/pgvector:pg16" ).asCompatibleSubstituteFor ("postgres" )
20
- )
18
+ PostgreSQLContainer <?> pgvector = new PostgreSQLContainer <>("pgvector/pgvector:pg16" )
21
19
// }
22
20
) {
23
21
pgvector .start ();
You can’t perform that action at this time.
0 commit comments