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

instead of upsert query, fallback to default on PSQL <= 9.4 #16572

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jul 26, 2019

… in favor of the generic way

fixes #15613 properly, overrides #16461 and supersedes #16569 (Messy affair, could have been solved more elegantly, sorry :-/)

@kesselb
Copy link
Contributor

kesselb commented Jul 26, 2019

😞 I think a lot of people were happy about less log spam. Would it be possible to change that only for Nextcloud 16?

@nickvergessen
Copy link
Member

Well we should just make sure in this case it does not unnecessarily log it?

@MorrisJobke
Copy link
Member

Well we should just make sure in this case it does not unnecessarily log it?

It's a Postgres log. Nothing we control. We just catch the exception that the Postgres connection is throwing then and handle it properly. Unfortunately there is then still an entry in the Postgres logs.

@blizzz
Copy link
Member Author

blizzz commented Jul 29, 2019

So, what we could do instead then is to keep the upsert, but somewhere detect the Postgres version before and fall back to the old method if we're below 9.5. Does that make sense?

@oole
Copy link
Contributor

oole commented Jul 29, 2019

I would also go down the road that @blizzz suggested. Add an adapter for Postgres < 9.5 and use the new upsert only for Postgres > 9.5. As long as we have access to that version information this should be a reasonable solution.

@blizzz blizzz force-pushed the fix/15613/bring-back-psql9-compat branch from da196bd to 077e53c Compare July 30, 2019 22:53
@blizzz blizzz changed the title removes the specific upsert query which is available on PSQL 9.5 only instead of upsert query, fallback to default on PSQL <= 9.4 Jul 30, 2019
@blizzz
Copy link
Member Author

blizzz commented Jul 30, 2019

Changed it as discussed, yet need to test against an old Pg tomorrow.

@kesselb
Copy link
Contributor

kesselb commented Aug 5, 2019

This way we introduce a additional query for a static information. I would suggest to add a config variable pqsql.upsert (like mysql.utf8mb4). There should be (if possible) a repair job to detect the pqsql version and set enable upsert if pqsql > 9.4 during upgrade.

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good

@MorrisJobke MorrisJobke mentioned this pull request Aug 8, 2019
28 tasks
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure lets do this

because there is no upsert yet

Signed-off-by: Arthur Schiwon <[email protected]>
@rullzer rullzer force-pushed the fix/15613/bring-back-psql9-compat branch from 077e53c to d040954 Compare August 14, 2019 07:05
@rullzer rullzer merged commit f7152cc into master Aug 14, 2019
@rullzer rullzer deleted the fix/15613/bring-back-psql9-compat branch August 14, 2019 08:10
@blizzz
Copy link
Member Author

blizzz commented Aug 20, 2019

/backport to stable16

@backportbot-nextcloud
Copy link

backport to stable16 in #16814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NC 16+ uses SQL that is only supported in Postgresql >= 9.5
6 participants