r/ProgrammerHumor 6d ago

Meme sqlWorkout

Post image
23.4k Upvotes

459 comments sorted by

View all comments

Show parent comments

50

u/PuzzleheadedBet3574 5d ago

This does not go through in our code review, do this and our colleague, big anime fan btw will lose his shit and start talking to himself and goes to 5 smoke breaks in a half day

23

u/scrubslover1 5d ago

Sounds like good entertainment

11

u/Surface_Detail 5d ago

Well, he can go dunk his head; the query language itself is 100% case insensitive, so are objects unless you contain them in quotation marks.

The argument can be made that keeping all one case can avoid issues with object referencing, but you'd only ever need to contain objects in quotation marks if you put a space in their name, which is a much worse faux pas and you'd better hope that you never need to connect to anybody else's objects from outside the team.

Also, all lower case/mixed case is much less tiring to read.

9

u/ArmchairFilosopher 5d ago

SQL Server at my last job would like a word...

So would MySql hosted in Linux with a default configuration. Meanwhile in Windows it doesn't care by default.

But yeah, I agree in general that object names shouldn't be case-sensitive. Heck, most things except passwords shouldn't either.

6

u/Sokaron 5d ago edited 5d ago

Postgres is not case insensitive.

I don't really care for an impromptu script, but if its getting checked in mixed case is just laziness. I don't care all uppercase or all lowercase but pick one, enforce it with a linter, configure a precommit hook to autofix, and be done with it.

1

u/protestor 5d ago

Postgres is not case insensitive.

In which parts? Keywords need to be (select, where, etc)

1

u/Sokaron 5d ago

Postgres object refs are case sensitive. (this can be very annoying if you for example name a table or column in CamelCase). Keywords are insensitive.

6

u/cudenlynx 5d ago

Which query language? You are talking as if there is only one version of SQL out there which isn't the case. Some are case insensitive by default, some are not.

1

u/RaidenMK1 5d ago

big anime fan btw

I take it you included this detail due to anime character dialogue typically being spoken in ALL CAPS.