Skip to content
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

Upload to Postgres: Siard tries to create schema twice #101

Open
MarkusGehrig opened this issue Jun 25, 2024 · 3 comments
Open

Upload to Postgres: Siard tries to create schema twice #101

MarkusGehrig opened this issue Jun 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@MarkusGehrig
Copy link

When uploading a Siard file to postgres, it looks like Siard is trying to create the database schemas twice. We are using SIARD 2.2.145 and PostgreSQL 16.3 with a freshly created database. The SIARD file contains several schemas. These schemas come from an Oracle database.

java.sql.SQLException: Schema "AG_BG_AAR" could not be created! Map "AG_BG_AAR" to existing schema. at ch.admin.bar.siard2.cmd.MetaDataToDb.upload(MetaDataToDb.java:591) at ch.admin.bar.siardsuite.service.database.DatabaseUploadService$DatabaseUploadTask.call(DatabaseUploadService.java:70) at ch.admin.bar.siardsuite.service.database.DatabaseUploadService$DatabaseUploadTask.call(DatabaseUploadService.java:39) at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at javafx.graphics/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at javafx.graphics/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

@mburri
Copy link
Collaborator

mburri commented Jun 27, 2024

@MarkusGehrig
Are you sure that the schema is created twice? A quick glance at the code showed me, that error is thrown if the schema does not yet exist.
Could you try to create the schemas in PostgresQL first? Does the same error occur?

Otherwise, it would be best for us if you could provide a minimal siard archive that reproduces the problem.

@MarkusGehrig
Copy link
Author

@mburri

Thank you for your reply.
It seems that SIARD created the schemas. I can see all the schemas that the source had in PostgreSQL.

In our test the database was empty, with no custom schemas or tables. The schemas you see in the picture below are created by SIARD at execution time.

c6ede88b-cb8d-4af6-8c08-95b29d3d21d3

A minimal SIARD archive is out of the question at the moment. The data we want to archive is strictly confidential and I'm not allowed to share it with you. Maybe I can try to get you some test data from a test system without confidential data, but first I would have to set up a new user with our DBA, which is not straightforward.

@mburri
Copy link
Collaborator

mburri commented Jun 28, 2024

Ok - I'll try to reproduce it myself and will report back

@Amasit Amasit added the bug Something isn't working label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants