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

replaces upsert with traditional catch #16569

Closed
wants to merge 1 commit into from

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jul 26, 2019

cf. #16461 (comment)

If that's all that is necessary, we can forward port it to master actually. Also since Stretch will be around for a while. Then we undo the >=9.5 check.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz added bug 3. to review Waiting for reviews labels Jul 26, 2019
@blizzz blizzz added this to the Nextcloud 16.0.4 milestone Jul 26, 2019
@blizzz
Copy link
Member Author

blizzz commented Jul 26, 2019

@oole would be nice if you could check this, too

@blizzz blizzz requested a review from oole July 26, 2019 15:33
@kesselb
Copy link
Contributor

kesselb commented Jul 26, 2019

public function insertIgnoreConflict(string $table,array $values) : int {
try {
$builder = $this->conn->getQueryBuilder();
$builder->insert($table);
foreach($values as $key => $value) {
$builder->setValue($key, $builder->createNamedParameter($value));
}
return $builder->execute();
} catch(UniqueConstraintViolationException $e) {
return 0;
}
}

Looks similar. Why don't you remove the child implementation? #12729 A lot of pgsql users will see these warnings in their logs again.

Also since Stretch will be around for a while

https://packages.debian.org/search?suite=stretch&keywords=postgresql 🤔

@nickvergessen
Copy link
Member

We can then also revert the required postgres version to 9?

@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 26, 2019
@blizzz
Copy link
Member Author

blizzz commented Jul 26, 2019

We can then also revert the required postgres version to 9?

that's against 16 now, there we didn't increase it yet.

@blizzz
Copy link
Member Author

blizzz commented Jul 26, 2019

Looks similar. Why don't you remove the child implementation?

Yes, why, I actually looked at it. You're right, we can get rid of it.

@blizzz
Copy link
Member Author

blizzz commented Jul 26, 2019

Anyhow, on UCS with 9.4 it works at least in regular operation, did not come across an error case here. Let me get this done in master properly and we backport it. Messy affair, could have been solved more elegantly, sorry :-/

@blizzz blizzz closed this Jul 26, 2019
@blizzz blizzz deleted the fix/15613/stable16-bring-back-psql9.4 branch July 26, 2019 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants