News for hackers. Stuff that matters.
Re:New In Postgres 12: Generated Columns by Ididntdothis on Wednesday October 02, 2019 @05:55AM (#21134774)
I think it’s not only the procedural vs declarative difference but also just the plain syntax. To me SQL is just hard on the eyes. It feels a little like FORTRAN in the good old days.
Re:New In Postgres 12: Generated Columns by misterdoubt on Wednesday October 02, 2019 @07:25AM (#21135246)
Well it doesn't help that people continue using ALL CAPS for SQL keywords as a preferred style. In this century.
Re:New In Postgres 12: Generated Columns by zo1 on Wednesday October 02, 2019 @07:59AM (#21135455)
I find that it helps differentiate the different components of the query. Same way we use all-caps for constants, etc. If it's lower-case, or camel-case, then it just sort of "melts" into the rest of the query.
Re:New In Postgres 12: Generated Columns by icebraining on Wednesday October 02, 2019 @11:17AM (#21137359)
Also nice for differentiating it from the rest of non-SQL code.
Re:New In Postgres 12: Generated Columns by pletnes on Wednesday October 02, 2019 @09:17AM (#21136044)
Not with syntax highlighting.
Re:New In Postgres 12: Generated Columns by preommr on Wednesday October 02, 2019 @11:45AM (#21137712)
The tooling around sql is pretty awful. I was looking for a vscode plugin to get some syntax highlighting and linting for postgres yesterday, and just gave up. There are plenty of administrative tools that help with connecting to dbs and showing the results in a nice table, but nothing that really helps with writing it (or at least nothing of high quality that I could find).
Re:New In Postgres 12: Generated Columns by dewey on Wednesday October 02, 2019 @11:59AM (#21137872)
https://www.jetbrains.com/datagrip/ and Postico are pretty great for PG I think. I'm using them every day and having the option to attach DataGrip to a directory of queries in your code and directly executing them from there with set variables is pretty sweet.

It's helping you write queries by auto formatting and good auto completion.

Re:New In Postgres 12: Generated Columns by timrichard on Wednesday October 02, 2019 @10:03AM (#21136530)
Over the years, I must have annoyed various DBAs by saying "Is that a query, or a ransom note?"
Re:New In Postgres 12: Generated Columns by _jal on Wednesday October 02, 2019 @10:17AM (#21136688)
I so very wish this convention would die.

Also, leading a new line with the comma.

Re:New In Postgres 12: Generated Columns by tmd83 on Thursday October 03, 2019 @10:06AM (#21147078)
I actually like them both a lot for someone who is a developer who has spend hours fixing/optimizing large queries. As someone mentioned in another comment good syntax highlighting is often not available for sql (if any) so having the keywords separated is very helpful. When fixing and improving things I mostly care about 10% of the query, the JOINS and WHERE clause and CAPS keyword make those much easier to grasp. And the comma at the line start is very helpful (even though it looks odd for me) when you are adding/removing columns and sections on the fly. If the comma is at the start of the line you can simply comment, if it's at line end you need to edit two lines when removing a particular line from the query.