I’m sure you’d love to consider yourself infallible but human error can happen even to the best of us.
However if we’re talking from idealistic perspective then you’d have your own DBAs who would create the DB and write the SQL so your developers just call your (for example) stored procedures like APIs rather than writing their own - often unoptimised - SQL themselves.
The reason is that scp was designed as a secure replacement for rcp, which was designed as a remote version of cp. The flags -p and -r were inherited from cp by rcp (see https://linux.die.net/man/1/rcp), so for compatibility scp had to use the same flags.
As for ssh, I haven't looked at its history, but I suspect it's older than scp; the intuitive flag for "port" is -p, so that's what ssh used.
Yes, I forgot the actual issue was not CTEs directly.
I agree the query could have written better (I am still getting my head around how to use LATERAL), but it worked fine in 9.6 and stopped working in 10. From a backward compatibility viewpoint, code working in one version should still work in the next (even if it isn't the best code.) Or at least, start issuing deprecation warnings one version before making it not work.
Anyway, posting this to HN has triggered someone to go rewrite my code for me (thanks Ants Aasma, whoever you are), so now my Postgres 10 upgrade blocker is solved :)
You're welcome. Wanted to see how hard it is to port a query over.
Postgres generally tries its best to not break users code. However sometimes it is necessary for making forward progress. In this case the undocumented behavior of set returning functions within select list had some pretty funky, mostly accidental, semantics that were getting in the way of executor improvements. For example try to figure out how to explain the output of these two queries on 9.6:
That is one example of a silent behavior change between versions that was justified that applications that are seeing that behavior are probably broken anyway. Set returning functions within case expressions had more reasonable behavior so to avoid silent breakage they were made to result in an error.
Deprecation warnings are nice in theory, but in practice they would require an unreasonable amount of effort to properly implement, not seeing any warnings still wouldn't be a guarantee that your application works on new version. And it seems most users ignore deprecation warnings anyway. Besides, it's not like you can avoid making the changes, you just have slightly less schedule flexibility on when to implement them.
Well maybe they shouldn't, but it's shitty to apply this kind of policy retroactively. (I don't know when they actually announced the fact that you can't deduct losses.)
1) This is not really a temporary table in the traditional
sense; you're creating a real table and then dropping it.
This has problems with concurrency (you can't have two
"real" tables with the same name), among other issues.
2) Temporary tables in Postgres suck because they bloat
the catalogs. Creating temporary tables regularly is
better avoided.
3) There's no real need to create a table of any kind. A
regular VALUES would do. (Though you might have to encode
some type information into the query.)
> Relating to wallhacks, they can use your last 1,000 matches, and if you're never/rarely surprised by a camping enemy, you're probably cheating. Your camera position moments before interaction with an obscured enemy is probably another indicator.
Do you actually play CS:GO proficiently? Because it doesn't sound like you do.
You are not wrong, although your example would not work in every SQL dialect (even when rewritten). Sybase's T-SQL does not have equivalent for LIMIT.[0]
My point being, there are some issues with regards to data purity and reasoning, particularly if you want a system where users can build custom reports.
And I just wish the original article highlighted that using floats would have these issues, and if writing SQL like this is important to you, then you might want to reconsider.
(As for your note in brackets, where I work, SQL is basically used as a scripting language. So we would do my example in SQL.)
[0] Yes, I know there is 'set rowcount', but you cannot do that within a sub select.