-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create PostgreSQL extention with PostgreSQLContainer #2728
Comments
There is a module for PostgresSQL , https://github.com/testcontainers/testcontainers-java/tree/master/modules/postgresql And it is published to public repos, https://mvnrepository.com/artifact/org.testcontainers/postgresql |
Yes I know and I can't figure out how to load extensions using PostgreSQLContainer |
@boukmi This worked for me private static PostgreSQLContainer setupPostgresContainer() {
PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer()
.withDatabaseName("integration-tests-db")
.withUsername("username")
.withPassword("password");
postgreSQLContainer.withInitScript("db/setup.sql");
return postgreSQLContainer;
} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
Saved my day, thank you so much. |
What should be the contents of |
Hi all,
I'm currently using
PostgreSQLContainer
to create a dockerized PostgerSQL container. I need to create a few extensions when the container starts.Here is wht I did:
and here is the script content:
This does not seem to work because I keep getting this error when I try to create a table that uses
UUID
:That means that
uuid-ossp
has not been added.What is the correct way to add extensions to
PostgreSQLContainer
container?Thank you so much for your help guys.
The text was updated successfully, but these errors were encountered: