Skip to content

Feature/postgresql common#118

Merged
JohnMcLear merged 6 commits intoether:masterfrom
Chocobozzz:feature/postgresql-common
Mar 28, 2019
Merged

Feature/postgresql common#118
JohnMcLear merged 6 commits intoether:masterfrom
Chocobozzz:feature/postgresql-common

Conversation

@Chocobozzz
Copy link
Copy Markdown
Contributor

Includes PR of @muxator #99

Share code between postgres and postgres_pool (#114)

Add writeCallback to remove method

This patch is already used on https://framapad.org/

This PR (in fact the @muxator commits) should fix ether/etherpad#3511 on PostgreSQL >= 9.5

Ping @ldidry

muxator and others added 6 commits August 28, 2017 16:09
This is a preparatory commit to centralize the UPSERT statement before refactoring it.
Refactoring only: no functional changes.
Postgresql >= 9.5 and CockroachDB natively support UPSERT statements (ON CONFLICT ... DO UPDATE).

- when initializing the library, we run an EXPLAIN INSERT ... ON CONFLICT to check if the construct is supported
- if this succeeds, the UPSERT will be done done natively via ON CONFLICT ... DO UPDATE (Postgresql >= 9.5 and CockroachDB)
- if this fails, we will continue using the old behaviour of emulating UPSERT via ueberdb_insert_or_update() (Postgresql <= 9.4)

Among other things, this commit makes UeberDB compatible with CockroachDB
@muxator
Copy link
Copy Markdown
Contributor

muxator commented Mar 27, 2019

@Pita , @JohnMcLear, could this be merged, please?

@JohnMcLear JohnMcLear merged commit 75ffd8f into ether:master Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: duplicate key value violates unique constraint

3 participants