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

Postgres support #991

Merged
merged 21 commits into from Jul 29, 2015
Merged

Postgres support #991

merged 21 commits into from Jul 29, 2015

Conversation

mapkyca
Copy link
Member

@mapkyca mapkyca commented Jul 29, 2015

Closes #76

This is very much experimental, because Postgres was giving me a headache, but I'm like a dog with a bone with this sort of thing ;)

Things not working quite yet:

  • Full text search
  • A better way to do on delete insertions (not supported by postgres)

benwerd added a commit that referenced this pull request Jul 29, 2015
@benwerd benwerd merged commit 84a0ee3 into idno:master Jul 29, 2015
@aaronpk
Copy link
Contributor

aaronpk commented Jul 29, 2015

What do you mean "on delete insertions"? Postgres supports triggers which let you do some pretty fancy stuff.

@mapkyca
Copy link
Member Author

mapkyca commented Jul 29, 2015

Probably, but I didn't really have time to figure out the various UPSERT syntaxes ;) Someone who's a bit more of a postgres wizz will be able to make this much better I'm sure! But hopefully this is a useful starting point ...

@mapkyca mapkyca deleted the postgress branch July 29, 2015 22:37
@kylewm
Copy link
Collaborator

kylewm commented Jul 30, 2015

ah, I see MySQL's insert ... on duplicate key update ... is not supported by Postgres. It looks like version 9.5 will introduce insert ... on conflict (_id) do update ... but it'll be quite a while until that's in most server distros.

it looks like the recommended way to make atomic upserts in older versions is with PLSQL and an exception handler, yuck. http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE

@aaronpk
Copy link
Contributor

aaronpk commented Jul 30, 2015

Yeah or just do it in code to avoid the problem. As soon as you start relying on the database for fancy tricks like "on duplicate key update" you're going to be less portable.

@kylewm
Copy link
Collaborator

kylewm commented Jul 30, 2015

Yeah, that is what @mapkyca did

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.

None yet

4 participants