News for hackers. Stuff that matters.
Re:Migrating to Postgres by bastawhiz on Wednesday May 14, 2025 @07:50PM (#43990398)
> ORMs turn SELECT * into each individual column

This is a safety feature. If my code expects columns A, B, and C, but the migration to add C hasn't run yet and I'm doing something that would otherwise `SELECT `, my query should fail. If the ORM _actually_ does `SELECT ` I'll get back two columns instead of three and things can get spooky and bad real fast (unless the ORM manually validates the shape of the query response every time, which will come with a real runtime cost). If there are columns that the ORM doesn't know about, you could end up with _far more_ data being returned from the database, which could just as easily cause plenty of spooky issues—not the least of which being "overwhelming your network by flooding the client connections with data the application doesn't even know exists".

Re:Migrating to Postgres by to11mtm on Thursday May 15, 2025 @10:22AM (#43995420)
> (unless the ORM manually validates the shape of the query response every time, which will come with a real runtime cost).

Semi related to this, the ORM explicitly specifying columns ensures that the shape is consistent which both makes for a faster parse of the rows coming back (And, again, eliminates surprises for the parser.)