# PostgreSQL sequence nextval

**URL:** <https://forum.elixirforum.com/t/postgresql-sequence-nextval/19803>\
**Category:** Questions\
**Tags:** ecto\
**Created:** [January 31, 2019, 1:09am UTC](https://forum.elixirforum.com/t/postgresql-sequence-nextval/19803 "2019-01-31T01:09:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![slashmili](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slashmili/32/1047_2.png) [@slashmili](https://forum.elixirforum.com/u/slashmili)\
**Post date:** [January 28, 2025, 12:30am UTC](https://forum.elixirforum.com/t/postgresql-sequence-nextval/19803/6 "2025-01-28T00:30:48Z")

</div>

Interesting approach @arcanemachine !

A word of caution about retrieving the last value - there’s an important concurrency consideration to keep in mind. The `get_next_available_id` approach can lead to multiple processes request an ID simultaneously and get the same ID.

---

_[View the full topic](https://forum.elixirforum.com/t/postgresql-sequence-nextval/19803)._
