-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unable to use on-conflict-do-nothing
flag due to other missing flags that cannot be supplied
#153
Comments
on-conflict-do-nothing
flag due to other missing flags that cannot be addedon-conflict-do-nothing
flag due to other missing flags that cannot be supplied
Hi! Thanks for sharing your feedback. I'm glad to hear that Greenmask is helping you. By the way, I agree it's a bit controversial that not all I believe it's necessary to implement such options, and here’s a list of tasks we need to address:
|
I will add it to the backlog. It might be done at the end of this quarter or in the beginning of the Q4 2024. |
@wwoytenko thanks for your input, and great to hear that you're planning on picking this up. To give a bit more insight into our intended use-case: we mainly want to use Greenmask for our dev team to quickly get up-and running locally with an anonymized but true-to-life db. Greenmask fulfills this need really well. The feedback I get from our team is that it would be even better to allow them to re-run the restoration process periodically to get new data. Now they have to set up a new, empty database for this. It would be really nice if they could just run a restore operation again. Happy to provide you with some input when needed. Thanks! |
@bjorngoossens thank you so much for the details. There are a few points we need to clarify to determine the best implementation approach based on the requirements. Description: According to the PostgreSQL docs
When using
However, this approach only works for unique or exclusion constraints. If a foreign key is not present in the referenced table, the insertion will still fail. For example:
How critical is this issue? Do you want to rely on other constraints like check constraints or foreign keys? In my opinion, it might be acceptable to ignore other constraints as well, at least as an option. In this particular case, we could resolve the issue by inserting data using a transaction per statement. If the driver returns an error indicating a constraint violation, we can choose to skip that insertion. The downside is that the target table may become significantly bloated. |
I've made MR #157 which has to close this feat request |
It is closed by #157 |
Hi all, great tool you're working on!
Using Greenmask for dumping/restoring full databases works well for us. However, we'd really like to be able to restore multiple times and skip any data that causes conflicts. The underlying
pg_dump
command has a feature flag for this:on-conflict-do-nothing
. This is also listed in the available flags in the documentation.However, when I try to run a dump with this flag enabled,
pg_dump
gives me this output:pg_dump: error: option --on-conflict-do-nothing requires option --inserts, --rows-per-insert, or --column-inserts
I cannot figure out how to supply any of these additional flags to Greenmask, and I also don't see them listed as possible options in the documentation linked above. I also don't see any reference to these flags in the file that is used to supply the
on-conflict-do-nothing
flag.Am I missing something to make
on-conflict-do-nothing
work nonetheless? Or should these options/flags be added to Greenmask to make it work. Thanks in advance for your help!The text was updated successfully, but these errors were encountered: