Where database blog posts get flame-broiled to perfection
Alright, settle down, kids. Let me put down my coffee—the kind that's brewed strong enough to dissolve a spoon, not your pumpkin spice soy latte—and read this... this manifesto.
Heh. "Database interoperability is a common requirement." You don't say. It's only been a common requirement since the second database was invented, probably on a clay tablet next to the first one. We were trying to get a VSAM flat file to talk to a DB2 relational table while you were still trying to figure out how to share your Legos. But please, tell me more about this revolutionary concept.
So you've got this... oracle_fdw. A "foreign data wrapper." How precious. It's a cute name for a gateway. Back in my day, we called it "writing a goddamn COBOL program with a cursor." You wrote a batch job, you fed it a stack of punch cards that would choke a donkey, and it ran overnight. By morning, you either had your data or a sixteen-pound printout of hexadecimal error codes that you'd spend the rest of the day deciphering. We didn't call it an "excellent and efficient solution," we called it "doing your job."
But this is where it gets good.
How do we perform the reverse? How can an Oracle SQL query execute a SELECT statement […]
You're telling me you built a beautiful, one-way street with all your fancy extensions and wrappers, and now you're standing at the other end, scratching your heads, wondering why you can't drive back? Congratulations. You've engineered a cul-de-sac and are trying to sell it as a freeway interchange.
This is what happens when you don't think more than one step ahead. Back in '89, we had to sync the production mainframe with the new AS/400 the marketing department bought without telling anyone. We didn't have a "wrapper." We had:
You kids and your "efficiency." You think efficiency is a low-latency query. Let me tell you about efficiency. Efficiency is swapping out the right tape reel from a library of thousands for the nightly backup, in a server room that's 55 degrees, while the graveyard shift operator is telling you about his conspiracy theories. Efficiency is making sure that when that tape gets shipped to the Iron Mountain salt mine, it's the right damn tape, because if it's not, you're not restoring anything. You're just updating your resume.
Mark my words, this little Oracle-to-Postgres pipe dream will work beautifully... until it doesn't. The first time a network packet gets sneezed on sideways or Oracle pushes a minor patch that changes one tiny authentication protocol, this whole fragile contraption will fall apart. You'll get errors so cryptic they'll look like they were written in Elvish. And everyone will stand around pointing fingers because the "wrapper" was supposed to be a magic black box that just worked.
Nothing just works. We learned that the hard way when a cleaning lady unplugged the mainframe to plug in her vacuum. You'll learn it when your "seamless integration" costs you a terabyte of unrecoverable customer data.
Now if you'll excuse me, I've got to go check on a batch job that's been running flawlessly since 1992. Let me know when you figure out how to build a two-way street. I'll be here. Probably.