Anmelden

Postgres FM· Folge 111

Get or Create

Freitag, 23. August 2024 · 50 min

MP3

Shownotes

Michael and Nikolay are joined by Haki Benita, a technical lead and database enthusiast who writes an excellent blog and gives popular talks and training sessions too, to discuss the surprisingly complex topic of trying to implement “get or create” in PostgreSQL — handling issues around idempotency, concurrency, and bloat.

Here are some links to things they mentioned:
• Haki Benita hakibenita.com
• How to Get or Create in PostgreSQL (blog post by Haki) hakibenita.com/postgresql-get-or-create
• "Find-or-insert" using a single query (how-to guide by Nikolay) gitlab.com/postgres-ai/postgresql-consulting/p…
• Is SELECT or INSERT in a function prone to race conditions? (Answer by Erwin Brandstetter) stackoverflow.com/questions/15939902/is-select…
• get_or_create() in Django docs.djangoproject.com/en/5.1/ref/models/query…
• Subtransactions Considered Harmful (blog post by Nikolay) postgres.ai/blog/20210831-postgresql-subtransa…
• MERGE (Postgres documentation) postgresql.org/docs/current/sql-merge.html
• Hidden dangers of duplicate key violations in PostgreSQL and how to avoid them (blog post by Divya Sharma and Shawn McCoy from the RDS team) aws.amazon.com/blogs/database/hidden-dangers-o…
• One, Two, Skip a Few... (blog post by Pete Hamilton from Incident) incident.io/blog/one-two-skip-a-few

~~~
What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, (postgres.fm/people) or by commenting on our Google doc (docs.google.com/document/d/1PNGSn_d0A7gTR4C0p6…)!

~~~
Postgres FM is produced by:
• Michael Christofides, founder of pgMustard (pgmustard.com)
• Nikolay Samokhvalov, founder of Postgres.ai (postgres.ai)

With special thanks to:
• Jessie Draws for the elephant artwork

Anmelden oder registrieren

Jetzt

0:00 / 0:00