正在加载视频...

视频加载失败

postgres is the best database

383,362 次观看 • 9 个月前 •via X (Twitter)

45 条评论

thibauld 的头像
thibauld9 个月前

"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 的头像
Sam Meech Ward9 个月前

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

Tristan Rhodes 的头像
Tristan Rhodes9 个月前

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

Sam Meech Ward 的头像
Sam Meech Ward9 个月前

Yes

Horncle Ola 的头像
Horncle Ola9 个月前

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

Sam Meech Ward 的头像
Sam Meech Ward9 个月前

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

Horncle Ola 的头像
Horncle Ola9 个月前

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

Roman 的头像
Roman9 个月前

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

Sam Pullara 的头像
Sam Pullara9 个月前

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

MyPayIndia 的头像
MyPayIndia9 个月前

Tried this on my database it didnt work

Sam Meech Ward 的头像
Sam Meech Ward9 个月前

time to switch to postgres

MyPayIndia 的头像
MyPayIndia9 个月前

How do i get my tables back theres nothing

Eniola | FullStack Developer 的头像
Eniola | FullStack Developer9 个月前

@Meech_Ward Eyaaaaaa pele 🤣🤣🤣🤣🤣

MyPayIndia 的头像
MyPayIndia9 个月前

@Meech_Ward Eyaaaaaaaaaaa

MyPayIndia 的头像
MyPayIndia9 个月前

@Meech_Ward nya

Kimmo Tamio 的头像
Kimmo Tamio9 个月前

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

6ix 的头像
6ix9 个月前

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

ninken 的头像
ninken9 个月前

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

Andrei 的头像
Andrei9 个月前

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 的头像
Samir9 个月前

What if you commit it can you roll back? 🤣

Esteban Puerta 的头像
Esteban Puerta9 个月前

postgres is basically the everything app

throwabull 的头像
throwabull9 个月前

lol, wtf.

rishav.js 的头像
rishav.js9 个月前

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

Niwin Kumar 的头像
Niwin Kumar9 个月前

“Try this out on your database” 😂😂

Noma 的头像
Noma9 个月前

How about supabase?

Sam Meech Ward 的头像
Sam Meech Ward9 个月前

Supabase is the best way to use Postgres

AL Bot 🇦🇱🇽🇰🇪🇺 的头像
AL Bot 🇦🇱🇽🇰🇪🇺9 个月前

Oracle FLASHBACK says hold my beer! 🤣🤣

Huibert-Jan Nieuwkamer 的头像
Huibert-Jan Nieuwkamer9 个月前

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 的头像
Richard Oliver Bray9 个月前

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

ArtosPortos 的头像
ArtosPortos9 个月前

@supabase and cheaper than Oracle and SQL Server

K12 的头像
K129 个月前

Not today 😂

Gindi4711 的头像
Gindi47119 个月前

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 的头像
Marco Pfeiffer9 个月前

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 的头像
Cire Jr9 个月前

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 的头像
Lee Penkman9 个月前

Also remember to take backups people!!

Sobieski 🇵🇱 的头像
Sobieski 🇵🇱9 个月前

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

Blhe 的头像
Blhe9 个月前

I didnt work i will sue you.

Mathis Burger 的头像
Mathis Burger9 个月前

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

__ken17th__ 的头像
__ken17th__9 个月前

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

Kok Uyto 的头像
Kok Uyto9 个月前

No thanks 😂

SA Football Players Abroad 🇿🇦 的头像
SA Football Players Abroad 🇿🇦9 个月前

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

Rajan 的头像
Rajan9 个月前

Should i try on the Production Database ??🥲

InfraNext 的头像
InfraNext9 个月前

Absolutely!

Chocobo 的头像
Chocobo9 个月前

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 的头像
Devansh9 个月前

indeed

相关视频