# \#ecto-insert

**URL:** https://forum.elixirforum.com/tag/ecto-insert/1991.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Ecto \`insert()\` with \`returning: true\` on Postgres - request for clarification](https://forum.elixirforum.com/t/ecto-insert-with-returning-true-on-postgres-request-for-clarification/43157)

<div class="topic-metadata">

**Author:** [@silverdr](https://forum.elixirforum.com/u/silverdr)\
**Replies:** 14\
**Last updated:** [September 30, 2025, 4:03pm UTC](https://forum.elixirforum.com/t/ecto-insert-with-returning-true-on-postgres-request-for-clarification/43157 "2025-09-30T16:03:42Z")

</div>

From another thread - making it a separate topic: To make sure I understand correctly (because TFM seems ambiguous on this to me): When there’s conflict (like a UNIQUE constraint being violated), does the insert/2 fu…

---

## [Edit the fields of an Ecto record in a destructuring for a test](https://forum.elixirforum.com/t/edit-the-fields-of-an-ecto-record-in-a-destructuring-for-a-test/44808)

<div class="topic-metadata">

**Author:** [@Euphorichuman](https://forum.elixirforum.com/u/Euphorichuman)\
**Replies:** 5\
**Last updated:** [December 24, 2021, 10:34pm UTC](https://forum.elixirforum.com/t/edit-the-fields-of-an-ecto-record-in-a-destructuring-for-a-test/44808 "2021-12-24T22:34:16Z")

</div>

I’m currently creating a test to test a LiveView phx-click event. For the above, I have the following setup for the tests: setup do %{id: follower\_id, show: %{slug: slug, id: show\_id} = show} = insert(:follower) …

---

## [Many\_to\_many ecto](https://forum.elixirforum.com/t/many-to-many-ecto/31127)

<div class="topic-metadata">

**Author:** [@NewBee](https://forum.elixirforum.com/u/NewBee)\
**Replies:** 3\
**Last updated:** [May 4, 2020, 9:31am UTC](https://forum.elixirforum.com/t/many-to-many-ecto/31127 "2020-05-04T09:31:21Z")

</div>

I was trying to update my attributes tags which a list (many\_to\_many) but the update deletes the old data and put the new one ! how Can I do so I keep the old ones and add other data? thank you

---

## [Ecto Changeset and Form validation and update using PUT](https://forum.elixirforum.com/t/ecto-changeset-and-form-validation-and-update-using-put/26640)

<div class="topic-metadata">

**Author:** [@ashok](https://forum.elixirforum.com/u/ashok)\
**Replies:** 14\
**Last updated:** [November 13, 2019, 10:49pm UTC](https://forum.elixirforum.com/t/ecto-changeset-and-form-validation-and-update-using-put/26640 "2019-11-13T22:49:34Z")

</div>

I have managed to list the records from my DB to the front end but not able to update , insert and apply form validation error please suggest http://localhost:4000/admin/income-cards/1/edit Has form as shown below: \<%…
