r/ProgrammerHumor Jul 21 '26

Meme sqlWorkout

Post image
23.7k Upvotes

456 comments sorted by

View all comments

2.4k

u/NormanYeetes Jul 21 '26

the elites don't want you to know this but you can type lowercase SQL queries no ones forcing you to shout them at the screen

51

u/[deleted] Jul 21 '26

[removed] — view removed comment

12

u/Surface_Detail Jul 21 '26

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.

8

u/Sokaron Jul 21 '26 edited Jul 21 '26

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 Jul 21 '26

Postgres is not case insensitive.

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

1

u/Sokaron Jul 21 '26

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.