princemaple

princemaple

Ok this is… more than weird

It’s also consistent during insert_all with conflicts. I’m trying to back fill some missing data from backup, but can’t because the db thinks they are already there…

I can’t have 20+ uuids with conflicts, right? That’d be too luck. I checked they are totally different from what’s coming back from the db. Repo.all(from x in X, where: x.id in ^my_ids) I get these 20+ results with totally different ids, but consistent!

Showing Posts 1 to 10

dimitarvp

dimitarvp

Can you show us what does v() do?

garrison

garrison

It’s an iex helper that returns the last line, essentially. I actually didn’t know about this one because I never use iex :slight_smile:

princemaple

princemaple OP

Yup. The screenshot is a remote iex. v() simply refers to the previous return value.

princemaple

princemaple OP

Sorry if it’s confusing. The tldr for this is: If I `Repo.get X, “abc”` I would expect an entry of X with id abc to be returned. Here it’s giving me something different.

Same thing during insert_all, it thinks something with a different id conflicts with the entry am trying to insert.

princemaple

princemaple OP

You can also do v(-2) to get the second last result.

And v(line_number) to get a specific line.

jswanner

jswanner

@princemaple,

odd question, but just making sure…

Is id the primary key field on the schema?

garrison

garrison

That is certainly odd! I think you need to do some more debugging here, though. There’s not really anything for us to go off of.

Is id the primary key? What is the id in the actual database? What is the DB schema? Could there be something weird going on with autogenerate? The changeset? Etc.

princemaple

princemaple OP

Yes :wink: haha

jswanner

jswanner

On slack you said this was a remote console, are you seeing the same behavior locally? Have you checked the generated query, or tried via psql (or other db client)?

princemaple

princemaple OP

Yes id is pk

I also suspected something with ecto or auto generate, hence the test at the top, about uuid dumping and loading. All seems good. It almost seems a pg problem but that would be too crazy to be true.

Where Next? Top

Trending in Questions Top

axelson
One of my LiveView view’s has a very heavy javascript dependency so I want to avoid loading it for every page on the site, while still us...
New
yasoob
Hi all! I know that quite a few people use Phoenix LiveView but it is hard to get a more up-to-date list of folks/companies using it. I ...
New
neurodynamic
I have a page in my Phoenix app with some LiveView code. When you click a button, it shows the Stripe credit card modal form via a Hook. ...
New
Hellowman
Hello everyone! I am new to coding with Elixir/Erlang. And i am looking for some utilities for fuzzing testing like AFL++. Does anyone ...
New
yarrichar
I’m very new to Elixir, so sorry if this is a silly question: I am wondering what happens to the mailbox of a process when the machine i...
New
mandar1045
I load tested a plain Phoenix chat app backed by Postgres with 100 million messages in it, everything on default settings, to see what br...
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
261 13183 112
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
charlenopires
Hi everyone :waving_hand: I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews