this post was submitted on 19 Oct 2023
1724 points (98.8% liked)
Programmer Humor
32479 readers
1165 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Speaking as a Senior Dev specialized in database access and design... you don't have to use all caps - SQL is actually case agnostic.
But... but my fucking eyes man. I'm old, if your branch doesn't have control keywords in all caps I'm going to take it out back and ol' yeller it.
There are few hills I'll die on but all caps SQL and singular table names are two of them.
The place I work decided to name all tables in all caps. So now every day I have to decide if I want to be consistent or I want to have an easy life.
Fuuuuck. That's why I love postgres... and fuck anyone that requires double quoted identifiers for special casing.
Postgres normalizes table and field names to lowercase, unless you put them in quotes. It's also case sensitive.
That means if you use quotes and capital letters when creating the table, then it's impossible to refer to that table without using quotes.
It also means if you rename the table later to be all lowercase, then all your existing code will break.
Still a much better database than MySQL though.
I'm quite aware... basically it means that novice devs can create a table in camelCase and query in camelCase... but you can clean it all up as long as they didn't realize you needed double quotes.
Fair point. I always disliked the design because ORMs pretty much always use quotes, so an entity-first approach can create a lot of tables with capital letters if you're not careful, which is then really annoying if you need to use raw SQL for anything.
That's just cruel.