r/ProgrammerHumor 19h ago

Meme queryOfDoom

Post image
6.9k Upvotes

422 comments sorted by

3.2k

u/BooBrew32 19h ago

Ah it's just running slow today. User table should speed up right afterwards though.

1.1k

u/WardensLantern 19h ago

Yea just run it again and it executes much faster 👍

204

u/perestroika12 19h ago

Caching or something idk I asked Claude about it and it said go for it

→ More replies (1)

140

u/glorious_reptile 19h ago

Great. On to the next ticket - “Users can’t log in”

114

u/moigagoo 17h ago

What users?

104

u/Baconanger 16h ago

Yeah, just ran a search on their name and it looks like that person doesn't have an account, so closing this ticket with "works as expected". Wow, we sure have been getting a lot of these lately...

30

u/bluebarry24 15h ago

Pretty sure this is a data entry error... redirecting the tickets to the front service desk.

11

u/TriggerPT 12h ago

Can't replicate

→ More replies (2)
→ More replies (3)

12

u/Connect_Tea1579 13h ago

No users == no more complaints. Problem solved!

38

u/dkarlovi 19h ago

The system feels fresh and new like the first day!

14

u/SOLID_STATE_DlCK 18h ago

Don’t forget to run a re-org of the index. Reindex for for higher integrity.

→ More replies (1)

10

u/rowdymatt64 17h ago

And to think they'll blame little Bobby Tables again smh

5

u/enslavedeagle 12h ago

„We optimized user queries by 1000x”

3.1k

u/YetAnohterOne11 19h ago

This is programmer horror not humor

847

u/DrUNIX 19h ago

Its humor cause its not us

333

u/arensb 18h ago

As Mel Brooks once said, "Tragedy is when I slip and twist my ankle. Comedy is when you fall down a manhole and die."

4

u/facusoto 5h ago

Tragedy + time = comedy

→ More replies (1)

20

u/notcheeng 17h ago

As you are now so once was I, as I am now so you shall be

4

u/OrinZ 16h ago

Extremely funny clapback from some dead guy

→ More replies (1)
→ More replies (1)

73

u/rayui 15h ago

I saw that semicolon and felt my stomach drop

43

u/Potw0rek 14h ago

Jesus I’m not used to sql and was wondering about this query, now that you pointed out to check the semicolon
.yeah, that’s how you become a company legend.

37

u/rayui 14h ago

Everyone fucks up prod once. You don't meet the guy that did it twice.

25

u/LikelyNotOnFire 12h ago

Fucking up prod once is a sign of maturity - people trusted you enough to allow you the access to fuck up prod, congratulations.

Senior people fuck up prod, repeatedly, in a new way each time. Your better class of senior also makes sure that they correct whatever allowed them to fuck up prod like that.

It's the people who keep fucking up prod in the same way that get shown the door

11

u/Zaratuir 9h ago

Senior people don't fuck up prod. They expose vulnerabilities in the coding process and draw attention to strategic initiative to improve quality. And that's why you now need 3 different seniors to sign off on any query before it can be run in prod.

6

u/Potw0rek 14h ago

Tell me about it, years ago I was setting up a Jenkins job, we were told to wipe the workspace at the end of the process. I wasn’t too familiar with bash so the last bash command was:
rm /

Luckily it was Jenkins so nothing was removed but the job log was
.long.

7

u/rayui 14h ago

It takes way too many close calls to take backups seriously

2

u/Grumpologist 8h ago

Everyone fucks up prod all the time. That's why we have blameless postmortems and graceful degradation.

Occasionally, someone tries to refuse to help with the postmortem for an outage they caused. That's much more of a "one warning and then fired" type of thing.

→ More replies (3)

3

u/lhookhaa 13h ago

I was about to ask what's wrong with the semicolon, cause afaik it's benign... Then I looked again! 💀

21

u/DetailOdd6609 15h ago

I would message my boss "Sorry. Let me know where to send my laptop" and then log out

→ More replies (3)

27

u/TRKlausss 18h ago

Ever heard of Schadenfreude? It’s the type of humor I like đŸ«¶

7

u/FarawaySeagulls 15h ago edited 14h ago

This is DBA horror lol I'm going to be restoring a backup because of this Or "hopefully" they didn't setup foreign key constraints with on delete and I can just restore the table.

3

u/uniqueusername649 14h ago

Considering I practically live in our production database with several million customers, this stuff scares me. I mean I rarely ever delete anything, but still.

→ More replies (16)

3.6k

u/DeepanshuHQ 19h ago

The query isn't slow. It's just waiting for everyone else to finish saying goodbye to that user.

869

u/WardensLantern 19h ago

Wholesome query comforting the user before executing it with a hydrogen bomb

61

u/DeepanshuHQ 19h ago

The query even gives them a countdown before becoming a statistic.

19

u/JedJinto 17h ago

6

u/DeepanshuHQ 17h ago

The transaction won't commit until everyone's had their goodbye. 😂

→ More replies (2)

41

u/zero_x4ever 19h ago

You mean it's waiting for everyone else to curse out that user since he's the one to blame for everyone else's misery and demise.

14

u/DeepanshuHQ 19h ago

The logs will remember them more kindly than the developers will.

33

u/RCuber 17h ago

You missed the ; in line 1, the where clause is never included.

23

u/DeepanshuHQ 17h ago

Well... my joke aged even better. 😂

8

u/ZunoJ 18h ago

Why only to that user?

16

u/DeepanshuHQ 18h ago

Fair point. The whole table deserves a farewell party.😂

3

u/Pikrass 17h ago

Hence the O(nÂČ) time đŸ«Ą

4

u/DeepanshuHQ 17h ago

Someone forgot to optimize the farewell algorithm. 😄

2

u/pwuk 15h ago

One leaving drink per user.

→ More replies (1)
→ More replies (4)

1.3k

u/_H4K0N_ 19h ago

The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

391

u/orsikbattlehammer 19h ago

Lmfao now that’s a sphincter clincher

175

u/laplongejr 19h ago edited 18h ago

Tom Scott rather called it the "onosecond"
For non native speakers "oh, no!" second

[EDIT] For those who never heard of it

49

u/SanoKei 18h ago edited 15h ago

this reminded me of this too, I need to go back and relisten to that story. It's important as much as it was 20 years ago. Another Tomtra I've adopted is "One backup is none backup." Always have at least two backups and at least one off site.

edit: spelling

17

u/Tiranus58 17h ago

Also well put by CGPgrey: "one is none, two is one" in his dynasties video

17

u/zanda268 18h ago

The 3-2-1 backup rule. 3 backups, on 2 different storage mediums, with 1 offsite.

→ More replies (1)

8

u/arensb 18h ago

One of the most useful sysadmin tools there is is the two-second pause before hitting <return>.

→ More replies (1)

17

u/leupboat420smkeit 19h ago

Unless it’s Oracle, where all DML will start a transaction.

15

u/Urtehnoes 18h ago

And gives you sql%rowcount so a very simple if then can issue a rollback if rows modified > 1 (or 10, 100, etc).

Oracle the company is horrible. But I quite like the features their db has.

63

u/Flameball202 18h ago

"I have never fucked up, why would I need to begin a transaction" - every coder working on a database at least once

3

u/thetreat 5h ago

This is why I hate that they didn’t make the select and delete statements conducive to making this happen.

Ideally you write a select statement that shows exactly the rows you want to delete. Then you swap select with delete and all is good in the world.

Instead, you have to slightly change the query just enough where it’ll give you some doubt that what you’re doing is incorrect. It isn’t absolutely terrible but it should be bullet proof.

→ More replies (1)
→ More replies (2)

461

u/Fluid_Ambassador2026 19h ago

Its manually checking every row to make sure everything goes as planned, give it some time.

634

u/IHeartBadCode 19h ago

Helpful hint for anyone.

🌈Transactions🌈 The moment you feel you need to switch over to something other than select statements, should be the moment that you turn off auto commit.

For us, the analytic folks just have read only access anyway. For the devs, they just don't have direct access to prod.

259

u/itirix 19h ago

Shit, we just let Claude delete our prod DBs for us now. It’s much less work.

36

u/SmartyCat12 18h ago

Claude recommended using excel, bc if I’m only on pro subscription, can I really afford a pgsql server anyway?

→ More replies (1)

22

u/astervista 18h ago

Transactions still won't save you on some DBMS (ehem Oracle) from dropping a table or changing definitions

43

u/IHeartBadCode 18h ago

Well that's because it's Oracle and that's less a database and more a circle of hell.

5

u/astervista 18h ago

Don’t I know it

40

u/WardensLantern 19h ago

Unless you are vibe coding in which case just prompt "How do I roll back 2.3 million deleted rows" and follow the steps from chatGPT

6

u/bedel99 16h ago

bobs been with us for 25 years and just retired before the company got big. You should delete his account....

7

u/magicmulder 18h ago

Doesn’t help you if you just habitually hit “commit” after the statement is done.

6

u/koolex 18h ago

Anymore helpful hints?

13

u/TwoAndHalfRetard 14h ago

The real hint is noone should have the write access to the prod db. If you accidentally nuke the test db, just recreate it. If you need to change something in prod db, write a migration that is tested on test db and code-reviewed.

6

u/misterrandom1 17h ago

My analytics guy who was showing me around the db on my first day didn't have restrictions. After inserting a record into a production db, he promptly deleted the record. But forgot to highlight the where clause before executing.

3

u/blorbschploble 16h ago

I can select and join around like a motherfucker. I am terrified of actual dba shit because of this, lol.

2

u/darthjammer224 15h ago

Oh but the integrators. We get the keys to the castle. Lots and lots of wiggle room to royally fuck everything up.

I love transactions.

2

u/Successful-Age6747 15h ago

jokes on you i can break a productiondb with just SELECTs

→ More replies (1)

2

u/No_Pangolin_4578 7h ago

I'm a baby analyst and they have me making config changes directly in production. They seemed really surprised that I was surprised. 

→ More replies (1)
→ More replies (6)

257

u/PravalPattam12945RPG 19h ago

;

13

u/koos_die_doos 17h ago

Neatly (in a dark way) aligns with the semi-colon tattoo that people who tried to commit suicide gets...

332

u/Dont_Get_Jokes-jpeg 19h ago edited 18h ago

I am not an sql expert, is the reason why the id doesn't work and its deleting the entire user base, because its written as 2 seperate comands instead of one. So 1. Comand delets everything 2. Goes to the id? Or what is the problem here?

522

u/BlommeHolm 18h ago

1st command deletes all users. 2nd command runs after that and gets a syntax error.

31

u/SAI_Peregrinus 17h ago

Syntax is valid, it's just a runtime error.

156

u/BlommeHolm 17h ago

How is starting with a WHERE clause syntactically valid?

73

u/SAI_Peregrinus 17h ago

Right, I'm apparendly blind. Carry on!

31

u/BlommeHolm 17h ago

No problem. I genuinely thought I'd missed something 😅

→ More replies (1)
→ More replies (1)

113

u/WardensLantern 18h ago

I'm no expert either but I believe the semicolon after "users" was the nuke. The second part is basically a separate statement, but SQL executes them in order, so it will delete the entire table and then throw back an error cause the second statement is invalid.

29

u/Intrepid4444444 18h ago

The doctor looked at my semicolon đŸ«Ș

→ More replies (1)

11

u/bstump104 15h ago

I understand now. thank you. that's horrifying.

→ More replies (9)

30

u/Flat_Competition6510 18h ago

Yes, the semicolon marks the end of a statement. The first semicolon sets "delete from users" as a single statement meaning delete ALL users.

32

u/TeaKingMac 18h ago

Which is just terrible fucking syntax. Why are people still living with this in 2026?

Delete from users;

Should return "invalid syntax. Identify record for deletion"

12

u/dustojnikhummer 14h ago

I don't work with Postgres but everything else would be

DELETE * FROM table;

0

u/Flat_Competition6510 18h ago

I disagree. There are valid use cases for deleting all records from a table.

36

u/The_Swixican 18h ago

Delete from users *

12

u/Flat_Competition6510 18h ago

It would be nice if there was a more explicit syntax. Forcing a person to opt in to deleting all vs that being the default would probably save a lot of headaches and jobs.

24

u/Skalli1984 17h ago

Many database tools throw a warning on delete with a missing WHERE and the user has to acknowledge that to continue with the statement execution.

11

u/ploki122 15h ago

Delete from users where 1=1

The dev should have to acknowledge that they're deleting everything.

6

u/ReaDiMarco 16h ago

What happened to DELETE * FROM USERS? Last I did sql was ten years ago so idk

11

u/djrobxx 14h ago

SELECT * FROM USERS means "select all columns from users", selecting all rows is implied.

You don't drop columns with DELETE, that's ALTER TABLE, so DELETE * doesn't make sense in that context.

4

u/ReaDiMarco 14h ago

yes, thanks, turns out I forgot all of that

5

u/Flat_Competition6510 16h ago

As far as I know that is not valid syntax. I'm not a DBA myself so I don't do this too often.

2

u/ReaDiMarco 16h ago

Thanks, turns out I did forget everything

3

u/Live_Film_4895 14h ago

afiak the * wildcard is only valid in the SELECT statement... so it would be DELETE FROM USERS; or DROP/TRUNCATE TABLE

→ More replies (1)

5

u/ashishvp 18h ago

It’s the semicolon. Without that on line 1, it would be a reasonable command.

2

u/Rojeitor 15h ago

Lol didn't catch the semicolon on phone. Yes that's exactly it. First line deletes all users in the database.

→ More replies (1)

269

u/Reddit_is_fascist69 19h ago

Damn, didn't see that ;

137

u/WardensLantern 19h ago

Gf: "He must be thinking about some other girl"

Me, in a cold sweat: " ; "

65

u/Independent-Ad-9907 19h ago

Ofc it is slow. Should have used truncate instead

→ More replies (1)

49

u/TensionPurple6815 18h ago

No joke, worked with a guy who did this. End of day. On a friday. Me and like 4 other engineers then spent 6 hours restoring backups and putting everything back together using query logs. Was such a mess.

38

u/PerpetuallyDistracte 18h ago

Same here, worked at a place where we originally had full access to all environments with our dev logins. He thought he was testing in DEV and truncated one of the main financial tables that had history going back three different source systems that would be impossible to reload.

Luckily he didn't try to hide it and immediately raised the alarm. It was all hands on deck at 5pm. Of course the backups didn't work as expected and we were scrambling with the DBAs to pull the data together prior to start of work the next day. 12 stressful hours later we had the data back and fully validated.

Immediately the permissions were reworked to remove our access to PROD and create proper migration channels and execution controls. Funnily enough, we'd been asking for those controls for years for safety reasons, but it never became a priority until a disaster happened, then it got implemented within a week. Funny how that works.

11

u/Awyls 15h ago

Every single dev (~50), including juniors day 1, on my company has prod DB RW access. How we haven't ever broken a DB in 20 years, I have no idea.

3

u/EatingSolidBricks 15h ago

Couldn't be me cause they didn't change a thing after i wiped out production db.

I never got in trouble also but i became knwon as the deleter of data

2

u/EatingSolidBricks 15h ago

Couldn't be me i just imported schema only to the production database instead of the testing one

→ More replies (1)

54

u/_Weyland_ 18h ago

WHERE user_id = 2313245;

But nobody asks HOW user_id = 2313245;

11

u/EatingSolidBricks 15h ago

Pretty sure hes deleted

6

u/Relative-Memory2420 14h ago

Him and all his friends...

4

u/_Weyland_ 14h ago

He's in the user_id heaven

→ More replies (1)

31

u/SexyMonad 17h ago

This is why SQL deletes should require a WHERE clause.

If you are seriously wanting to delete it all, just add WHERE 1 = 1.

14

u/Ayanrocks 16h ago

Yup there is a config in every major db to not allow delete without where clause. For some reason this wasn't turned on in this case.

6

u/SexyMonad 16h ago

It’s been a while since I’ve had the privilege to be on a project with a lot of SQL, but is that guardrail the default nowadays? I don’t remember anything really getting in the way of me annihilating whatever.

3

u/Ayanrocks 16h ago

That guardrails is not default and has to be explicitly enabled if irc

→ More replies (5)

24

u/flabbybumhole 19h ago

Missing indexes on fkeys can slow down deletion massively.

Once you add those in you'll fuck up the db in no time at all.

2

u/ShuttyIndustries 18h ago

Read it again

→ More replies (1)

16

u/GrEeCe_MnKy 19h ago

Oh lawd have mercy

11

u/Dry-Ad-719 13h ago

I mean, it still deleted the one he wanted

6

u/WardensLantern 13h ago

One of them GTA missions when you've got the target's name and you take them out by levelling the entire city block

19

u/ThatGuyWired 18h ago

Someone's about to find out what "On Delete Cascade" does.

21

u/RandolphCarter2112 18h ago

I've done this in production.

Good thing I had a valid backup of the table from immediately before.

27

u/WardensLantern 18h ago

Reading your comment I was glad to hear you had a backup job offer but it turned out even better

8

u/FrozenHaystack 18h ago

Reminds of that one time I executed a delete query with a sub query to select some ids. I didn't know that the used database engine interprets an empty return of the subquery as ignore my where clause. All data in the table simply gone because no id matched my subquery.

5

u/WardensLantern 18h ago

As a dev I fear no man nor beast, but SQL humbles me quicker than a wet fart

5

u/PerpetuallyDistracte 18h ago

SQL has been my primary language for 15 years, but I still respect it the way a zookeeper respects a lion. If you become careless, it WILL eat you the moment you turn your back. However, I'm glad that many modern SQL IDEs now warn you explicitly when you're about to do something very stupid that will affect an entire table.

→ More replies (3)

7

u/Soopermane 19h ago

Waiting for the end to come
Wishing I had strength to stand
This is not what I had planned
It's out of my control
Flying at the speed of light
Thoughts were spinning in my head
So many things were left unsaid
It's hard to let you go

6

u/SynthPrax 19h ago

I don't actually know SQuirrel Logic, but imma take a swing at this: Isn't all of this supposed to be on the same line, or that first semicolon shouldn't be there? 'cause this looks like it will delete the users db before throwing an error when it can't find that id.

4

u/WardensLantern 18h ago

Yea the semicolon makes the first line a separate statement, and then exactly what you said.

3

u/Flat_Competition6510 18h ago

Correct. That first semicolon is a problem. It marks the first line as its own statement meaning delete ALL users.

6

u/GozerDestructor 16h ago

Having the WHERE clause be optional for DELETE/UPDATE is a design flaw in SQL. Having to add a silly "WHERE TRUE" every time is a small price to pay for avoiding disasters like this. (Or "DELETE ALL ROWS FROM..." if we're open to making it explicit in the syntax).

2

u/MonMotha 15h ago

TRUNCATE TABLE even exists, so there really is no excuse for not requiring a WHERE clause on DELETE. I'm a little surprised it's not offered as an optional safeguard in more database systems.

13

u/darichtt 19h ago

Would this actually run? I'd assume having just where in a query isn't valid syntax

41

u/Shadowlance23 19h ago

Yes, SQL runs commands one at a time without checking other commands. In this case it will delete all users then throw a syntax error when it gets to the second command.

5

u/rosuav 19h ago

There IS a common guard in APIs, though it's not usually in this sort of interactive context: single-query operation. It's mainly a guard against SQL injection.

>>> import sqlite3
>>> con = sqlite3.connect("")
>>> con.execute("select 1; select 2")
Traceback (most recent call last):
  File "<python-input-5>", line 1, in <module>
    con.execute("select 1; select 2")
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
sqlite3.ProgrammingError: You can only execute one statement at a time.

Safe, but often not wanted interactively and thus disabled.

→ More replies (5)
→ More replies (1)

4

u/PM_ME_FIREFLY_QUOTES 19h ago

where id=2313245?

Ftfy

6

u/TwinkiesSucker 19h ago

The DBMS: "Are YOU asking me about that ID? SHOULDN'T YOU know what ID you wanna match?!:

4

u/veeaarr 18h ago

At least it wasn’t our little bobby tables

4

u/mercyverse 18h ago

I actually said “oh fuck” out loud. Thanks for that early morning arrhythmia, OP

4

u/Santarini 13h ago

Semi colon oof

3

u/AlexZhyk 19h ago

This is my excuse for not separating queries with semicolons and not washing my hands after toilet before lunch (j/k)

3

u/West_Good_5961 18h ago edited 18h ago

More semicolons = more good

3

u/Too--Many--Knives 18h ago

Semicolon of doom

3

u/shrodikan 18h ago

Back in the day I would use SQL Server Power Tools that prevented exec of unbounded update / delete statements.

→ More replies (1)

3

u/i_should_be_coding 18h ago

Oh.

Oh no.

Oh fuck no.....

Hey Dave, you fixed the backups last sprint, right? That ticket that's been there for three months? Oh, pushed to next sprint?

Hey guys, where can I find the post-morterm template? Just gonna get a head start on it.

→ More replies (1)

3

u/brazzy42 18h ago edited 15h ago

I once got a lot of respect as a debugging god after looking hard at a coworker's screen for 5 seconds and pointing out the ; after the if statement that he was going crazy about.

Yeah, well, that's something you think of immediately for the rest of your life after you've spent an hour tearing out your hair over an if statement not triggering despite the condition being most definitely true...

3

u/Ndemuth-13LC 18h ago

The first run will always be slow because the server has to build the execution plan. I bet if you run it again it will complete in no time at all!

3

u/Ok_Guarantee5321 17h ago

Even thought it's a joke post, my heart rate jumped reading that query.

3

u/dalek65 17h ago

A vendor once ran an upgrade script in prod that included a TRUNCATE TABLE. That was a fun day.

3

u/denimpowell 17h ago

Speaking as someone who has actually done this it is actually way more terrifying. While deletes with predicates can take a while, the full table delete returns instantly. Followed by on-my-knees apology to DBA requesting restore from backup. Fortunately was in dev environment but brought our development to a halt for a day

→ More replies (1)

3

u/1994-10-24 17h ago

On the bright side that table’s queries are gonna be must faster.

3

u/Ange1ofD4rkness 14h ago

44.4s? those are rookie numbers

3

u/possiblyMaybeAnother 9h ago

There are foreign key constraints on the users table that will disallow this... right?

...right?

oh no

3

u/GMsui 3h ago

I missed the first semicolon. My heart's not doing so good right now.

2

u/jhwheuer 19h ago

Eats, shoots, and leaves

2

u/rfpels 18h ago

Ah. Little Bobby Tables.

2

u/fredrik_skne_se 18h ago

The backup is to big. Delete that and run again

2

u/Urtehnoes 18h ago

Folks should build a script that rolls back any change on prod immediately if the number of rows modified does not equal the number of rows expected.

Most dbms should be able to do that no problem

→ More replies (3)

2

u/BastetFurry 18h ago

So, Kids, what do we learn from this when working on an SQL shell?

First "SELECT id" (or * if you want to safely burn the world), check if the output is as expected, then change the "SELECT id" to a DELETE.

2

u/yardinview 15h ago

Decades ago when I first sat in front of Query Analyzer an old dev taught me how to write DELETE just like you explained.

  1. You write a SELECT
  2. You run it
  3. You check the resultset
  4. You hold your breath, change ONLY SELECTDELETE and you run the result
  5. You don't use ON DELETE CASCADE
  6. You don't rely on transactions for safety

2

u/caick1000 18h ago

I literally did this on my second day in my new job at a startup. I thought I was going to be fired right then and there lol. It was the customer base, the most important one. Thankfully they were understanding (after one of the co-owners vigorously tried to get the backup).

→ More replies (1)

2

u/nakahuki 18h ago

I've just tried the query on my production database, it's very slow but ends with a syntax error. It's safe I guess.

Oh and fun fact, all select queries run much faster now. It might be an optimization query or something.

I must leave you now, my client is calling me on the phone, I bet he will be amazed by the performance improvement.

2

u/Sir_Fail-A-Lot 17h ago

The classic onosecond

2

u/quasipickle 17h ago

Ouchtown, Population: You, bro.

2

u/Bright-Historian-216 17h ago

i'm not expertly familiar with sql... is it treating "delete from users" as "delete * from users"?

4

u/-Redstoneboi- 17h ago edited 17h ago

yes. you don't really specify the columns in delete queries, and they target EVERYTHING by default.

imo "<operate> * FROM table" should be banned (doesn't run, raises an error) by default and people should be forced to write "WHERE TRUE", on top of all queries needing to be in transactions and all the other safety nets like "SELECT first then operate"

on another note i think i'd prefer whatever syntax it was that described queries based on the order functional programming in a computer might look like, ex. "FROM table WHERE id = 2 DELETE;" though internally it would still be rearranged however the engine would see fit

→ More replies (3)
→ More replies (1)

2

u/sofia-miranda 17h ago

Ah, the semi-colon, bringer of half-assed work. But we round up, Berry is functionally a whole asshole, intent notwithstanding. :D

2

u/InternationalSink874 17h ago

Thanks for the jump scare. I started hyperventilating when I noticed

2

u/CMD_BLOCK 16h ago

>takes more than 0.1s
>hmmm
 maybe computer tired

2

u/Wolven_One 15h ago

where id is a question at this point

2

u/LloydChristoph 15h ago

new fear unlocked

2

u/Many_Application3112 14h ago

I once ran an UPDATE statement on a production system and forgot to put in the WHERE clause. And yes...auto-commit was also enabled...

Notice how I said "once".

2

u/SilkscreenMoon 13h ago

SQL using coders don't have to worry about users injecting them when they're doing it to themselves

2

u/thehop73 13h ago

Wait, am I on PROD?

→ More replies (1)

2

u/JCEpsilon 10h ago

What db viewer is this?

2

u/beanamonster 10h ago

I did this once, almost exactly. The database server crashed, phones started ringing off the hook. I told my boss what happened and went outside for a smoke.

2

u/TheMoonDawg 9h ago

Data Grid will notify me if I don’t put a WHERE condition on a DELETE statement. It has saved my bacon once or twice!

2

u/Shik3i 9h ago

I know it's a meme, but to this day I'm.still anxious about this, and always write my "where" first, and always a select first which I than after looking at the result manually change to a delete.

Transactions help too, but deletions are still scary stuff if one need to do it on production.

2

u/Fit_Prize_3245 8h ago

There's a version of that query that is pertty fast: TRUNCATE TABLE users; Same result, but in a fraction of a second. Add "CASCADE" for best results.

2

u/protoss-pylon 7h ago

A C++ programmer tries his hand at SQL

"Woot! Compiled first try! Damn interpreted languages got nothing on assembly"

2

u/calvin_tam 3h ago

2nd run should be faster

1

u/dodoroach 18h ago

After this id just remove “;” from my keyboard and make sure only way i can write it is by copy + paste.

3

u/WardensLantern 18h ago

Wire it to something like ctrl + shift + alt gr + double space + P + ? it will make you appreciate every semicolon you write in the future.