Loading video...

Video Failed to Load

Go Home

postgres is the best database

383,362 views • 9 months ago •via X (Twitter)

45 Comments

thibauld's profile picture
thibauld9 months ago

"try this out on your database" LOOOL Don't forget to try this out with `sudo rm -fr /` too and let me know if it works for you 🙏

Sam Meech Ward's profile picture
Sam Meech Ward9 months ago

Make sure it’s on the production machine. I forgot to mention that

Tristan Rhodes's profile picture
Tristan Rhodes9 months ago

Thanks, I learned something. Soo.... your initial example was after a "begin;" command, right?

Sam Meech Ward's profile picture
Sam Meech Ward9 months ago

Yes

Horncle Ola's profile picture
Horncle Ola9 months ago

@supabase This is not specific to only Postgres, available on MySQL and most other RDBMS systems

Sam Meech Ward's profile picture
Sam Meech Ward9 months ago

@supabase Try this out on MySQL and let me know how it goes

Horncle Ola's profile picture
Horncle Ola9 months ago

@supabase Oh DDL don’t work in transactions in MYSQL my bad. Thought it was transaction specific

Roman's profile picture
Roman9 months ago

“Try this out on your database and let me know if that works for you” 😭🥴😂😂😂

Sam Pullara's profile picture
Sam Pullara9 months ago

very few databases have transactional ddl, one of my favorite things about postgresql. snowflake does have undrop though :)

MyPayIndia's profile picture
MyPayIndia9 months ago

Tried this on my database it didnt work

Sam Meech Ward's profile picture
Sam Meech Ward9 months ago

time to switch to postgres

MyPayIndia's profile picture
MyPayIndia9 months ago

How do i get my tables back theres nothing

Eniola | FullStack Developer's profile picture
Eniola | FullStack Developer9 months ago

@Meech_Ward Eyaaaaaa pele 🤣🤣🤣🤣🤣

MyPayIndia's profile picture
MyPayIndia9 months ago

@Meech_Ward Eyaaaaaaaaaaa

MyPayIndia's profile picture
MyPayIndia9 months ago

@Meech_Ward nya

Kimmo Tamio's profile picture
Kimmo Tamio9 months ago

Thanks brother, I'll try this on my clients prod DB 🙏

6ix's profile picture
6ix9 months ago

Yeah, I’ll quickly try this on Prod, I’ll get back to you. Thanks. 🙏🏽

ninken's profile picture
ninken9 months ago

I tried it on my company’s database and found out we don’t have rollback enabled. 🤣

Andrei's profile picture
Andrei9 months ago

I mean on MySQL you can revert a "DELETE FROM" if you are in a transaction. Most mistakes are done with a DELETE missing a where, not directly dropping a database. But when I deleted a 1M+ user database using DELETE FROM without a where many years ago. I did not use a transaction anyways, and even if I did, I would have committed the transaction. Transactions are not really made to fix mistakes, but more to fix code failures.

Samir's profile picture
Samir9 months ago

What if you commit it can you roll back? 🤣

Esteban Puerta's profile picture
Esteban Puerta9 months ago

postgres is basically the everything app

throwabull's profile picture
throwabull9 months ago

lol, wtf.

rishav.js's profile picture
rishav.js9 months ago

True! it really save so many time and setup and so easier to maintain

Niwin Kumar's profile picture
Niwin Kumar9 months ago

“Try this out on your database” 😂😂

Noma's profile picture
Noma9 months ago

How about supabase?

Sam Meech Ward's profile picture
Sam Meech Ward9 months ago

Supabase is the best way to use Postgres

AL Bot 🇦🇱🇽🇰🇪🇺's profile picture
AL Bot 🇦🇱🇽🇰🇪🇺9 months ago

Oracle FLASHBACK says hold my beer! 🤣🤣

Huibert-Jan Nieuwkamer's profile picture
Huibert-Jan Nieuwkamer9 months ago

Transactional ddl statements are great. It's the one big thing that I miss in Oracle. Specifically for drop table there is flashback, but HERE BE DRAGONS.

Richard Oliver Bray's profile picture
Richard Oliver Bray9 months ago

I remember seeing a similar video from you in Insta years back. Such a great tip 👍

ArtosPortos's profile picture
ArtosPortos9 months ago

@supabase and cheaper than Oracle and SQL Server

K12's profile picture
K129 months ago

Not today 😂

Gindi4711's profile picture
Gindi47119 months ago

As you instructed I tried it on my production database. Turned out my database does not support rollback after deleting a table. Now what is the next step?

Marco Pfeiffer's profile picture
Marco Pfeiffer9 months ago

True, but how often do you need that? What I need a lot more often is fast connection initialization. And yes, you can use connection pooling with Postgres with a reverse proxy, but it's just more complexity. I'm not saying Postgres is a bad database, but I think MySQL is still a valid choice for many projects. even though it does not have transactional DDL queries.

Cire Jr's profile picture
Cire Jr9 months ago

Any specific use case for this ? I know it looks cool, but most of the times, we don't drop tables knowingly, or with the intent of getting it back. So any specific use case would be appreciated

Lee Penkman's profile picture
Lee Penkman9 months ago

Also remember to take backups people!!

Sobieski 🇵🇱's profile picture
Sobieski 🇵🇱9 months ago

@grok , write a prompt that serves as a blocking guideline so that all transactions in postgres start with a BEGIN;

Blhe's profile picture
Blhe9 months ago

I didnt work i will sue you.

Mathis Burger's profile picture
Mathis Burger9 months ago

It’s in the SQL Standard language… almost any good RDBMS should support transactions. It’s an core concept

__ken17th__'s profile picture
__ken17th__9 months ago

This is similar to ACID transactions but Postgres don't fully comply with the ACID framework for transactions

Kok Uyto's profile picture
Kok Uyto9 months ago

No thanks 😂

SA Football Players Abroad 🇿🇦's profile picture
SA Football Players Abroad 🇿🇦9 months ago

I tried it in Prod and it didn’t work😭💔

Rajan's profile picture
Rajan9 months ago

Should i try on the Production Database ??🥲

InfraNext's profile picture
InfraNext9 months ago

Absolutely!

Chocobo's profile picture
Chocobo9 months ago

The intern who's gonna see this, run "begin" and 2 commands on the main table, never run rollback and go home for the weekend. In for a surprise Monday morning.

Devansh's profile picture
Devansh9 months ago

indeed

Related Videos