2026-10-23 14:01 UTC
@petarov@social.tchncs.de I was thinking it might be the visibility of the column name. Strange things happen if the same column name exists in both tables (outer and sub-query). What about osupdate_id?
Apart from such a visibility problem, I can't see anything obvious.
What exactly is the difference between the systems?
Are the tables involved being updated concurrently while the UPDATE runs? SQL Server's different locking strategy might come into play here.
Replies (1)
-
@petarov@social.tchncs.de 2026-10-23 18:26
@truls46@mastodon.social The problem is the `FROM osupdate AS ou ` part. This does not create an alias `ou` to the table `osupdate` in PostgreSQL but a self-join. Effectively the same table joined with itself. The result is every single `osupdate` row gets 0 for devices_count. MSSQL Server on the other side binds the target and the FROM, no copy. It's my fault using `FROM` in the first place, but yeah - still a lot to be learned about SQL.