Hacker News new | past | comments | ask | show | jobs | submit login
IvorySQL: Open-source Oracle-compatible PostgreSQL (github.com/ivorysql)
195 points by flymetothemoon on Dec 15, 2022 | hide | past | favorite | 70 comments



I want compatability in a whole different direction. Let's get really crazy and rip the db out from under vendor solutions. Let their app with its compiled in Oracle driver communicate with a Pg server. We'll completely void any support contract we have, but at least we'll be Oracle free!

Can you imagine just swapping in Postgres under a Peoplesoft deployment? As long as you don't make me actually attempt it, it makes me chuckle.


The software license will still stop you from doing that. No business that would need Oracle will run Oracle software knowingly violating the license.


It’s also likely in violation of arcane copyright law. The oracle wire protocol includes a handshake procedure that sends a poem in one of the initial messages. It’s untested legal theory whether copying that poem in a new work (e.g. a new driver or compatability layer) would violate Oracle’s copyright on the poem.

https://dacut.blogspot.com/2008/03/oracle-poetry.html


Weird, Apple does a similar thing with macOS startup on Intel (and more recently, Rosetta on Linux). If the magic haiku isn’t given the OS won’t start.

http://www.rcfp.org/sites/default/files/docs/20120105_202426... is when Apple tried to get the haiku protected as a trade secret

Bonus fun fact: Once the “don’t steal Mac OS” kext is loaded, a longer poem is loaded into memory (at least, it was around Tiger):

Your karma check for today:

There once was was a user that whined

his existing OS was so blind,

he’d do better to pirate an OS that ran great

but found his hardware declined.

Please don’t steal Mac OS! Really, that’s way uncool.

(C) Apple Computer, Inc.

(https://www.zdnet.com/article/apple-warns-off-os-pirates-wit...)


The thing that's "uncool" is that apple bundles their software and hardware together and won't let you buy just one of the two.


Very interesting. But I think there are pretty clear rules that permit compatible implementation of wire protocols.


Actually I’m pretty sure a lawsuit with Nintendo’s game boy drm (where you needed to have the logo in memory to boot) went to court and it was ruled that if working with the system required copying the copyrighted text then it’s fair use (US, long time ago and in a different but similar concept)


Is an encryption key copyrightable? Or a password?

Is it illegal to recite a copywrited work? Is it illegal to recite a translation of a copywrited work?

Can you copyright a number? For instance, a long binary number? If a piece of code contains a long binary number that it transmits to another device as a raw number, does it matter if the other device can arbitrarily interpret that number as a copyrighted work using SJIS or ASCII or some tortured encoding created just to turn a specific number into a specific copyrighted work? If the number was stored in UTF8 so that each 1 was encoded as 00000001 then decoded to a 1 for transmission, can you really claim any copywrite violation?

And why does my brain waste time thinking up such questions?


Please explain which license would be violated?


Huge benefit of SaaS is it makes the underlining database being used irrelevant.


It will be a success when it fully supports, Object Types, Packages, Autonomous transactions, PL/SQL, and BULK Collect Operations among other features.


Oracle Apex will have to be considered too.

It's undeniably a good platform for developing applications and firms get hooked on it.


That was my question. Is it compatible with PL/SQL? And how is the performance?


Somebody makes a Postgres variant that supports not only PL/SQL, but supplies a number of the standard DBMS_xyz packages. EnterpriseDB?


Yes, EDB's Advanced Server provides that: https://get.enterprisedb.com/docs/Database_Compatibility_for... (pp. 30 ff.).


Wiped out by Oracle's legal team (patents, whatever) in 4...3...2...


They haven't hit EnterpriseDB who have been doing the same thing, except not open source, since forever.


To my knowledge IBM's DB2 too has an "Oracle compatibility" switch that makes it also support PL/SQL.


Exactly. db2set DB2_COMPATIBILITY_VECTOR=ORA gives you Oracle compatibility. You can even get MySQL compatibility and I have actually used that once in the past.


A Korean company Tmax sells Tibero, the Oracle-compatible DBMS (proprietary). AFAIK, it's quite so much "compatible" (it even has same typos with Oracle DB), and they're not sued by Oracle.


Were they going to wipe out the SQL/PSM standard that has been approved by ISO?

"SQL/PSM is derived, seemingly directly, from Oracle's PL/SQL. Oracle developed PL/SQL and released it in 1991, basing the language on the US Department of Defense's Ada programming language."

https://en.m.wikipedia.org/wiki/SQL/PSM

They can always wipe out the Ada programming language while they're at it.


How can Oracle do it when they couldn't do it for the Java API?


As a fact, There are 2 ways to “win” a legal Fight, one is to get the desired judgment the other is to make fighting the case prohibitively expensive for the other party


I thought they "half-won" that case.


I don't get what this is. Is this a postgres fork? An extension? The documentation says it's Version 2 but the docs are rather lacking. Having something providing an "Oracle API" on Postgres would be awesome but not sure if this works like that?


> IvorySQL has imported and enhanced the Orafce extension to add support for numerous Oracle compatibility features including built-in PACKAGES, data types, and conversion functions

Sounds and looks like a fork to me.

EnterpriseDB used to offer some Oracle compatibility built on Pg, as a fork IIRC. Don't see it on their site any more though.

EDIT: Much thanks to replies with links to EDB.


Also, their docs leave me wondering about the level of Oracle compatibility they're claiming. Their page on the subject, https://www.ivorysql.org/docs/compatibillity_features/hierar... , lists a bunch of immediate sore points -- date types and functions, the CONNECT BY query syntax, etc. But there are other things Oracle supports that are not listed, and still potentially serious stumbling blocks -- "fast" (incremental) automatic refresh of materialized views, IGNORE NULLS in window functions, and so forth.

Oddly, I'd take their compatibility claims more seriously if they were more clearly up-front about the limits.


Am I one of the only developers who actually likes the CONNECT BY queries? Often I think they are a very succinct alternative to recursive CTEs.


I'll just fire this up, create some external tables, and use the v7 join syntax to write out my data with utl_file.


Does it need to be a fork, as opposed to just an extension?

I understand why upstream Postgres might not want to put Oracle compatibility in the core, since it would be adding a lot of crud which only a minority of people would benefit from. However, making sure the Postgres core has the extension points necessary to support extensions providing compatibility with Oracle (or DB2, MSSQL, MySQL, etc), is something they might be more willing to entertain.


The postgres 15 manual has a chapter on Oracle compatibility.

I don't know where to find it on their website, but the docs RPM that they provide bundles the PDF.


You are probably thinking of ECPG's "Oracle compatibility mode", which makes it behave more like Oracle Pro*C - https://www.postgresql.org/docs/15/ecpg-oracle-compat.html

However, few people actually use Pro*C nowadays. I spent almost 10 years working for Oracle, and I never once came across anybody using it. I think almost all use of it is in legacy applications which date back to the 1980s, first half of the 1990s at the latest. Obviously still enough use for Oracle to keep on supporting it, even with some occasional minor enhancements, but rather fringe all the same.

I don't think many people use ECPG either. I'm sure some people must, but I myself have never seen it. Probably most use is in porting existing applications from Oracle Pro*C, or its equivalents such as Informix E/SQL. Actually, it is interesting to observe that the section on ECPG's Informix compatibility mode is a lot longer than the Oracle equivalent. I don't know if that's because less compatibility is required (maybe Pro*C is closer to ECPG already), or if that's because Informix compatibility has received more investment.


I've used pro* C for a couple of things (in banking and utilties, 1990s) where people wanted interactive batch functionality for something more complex than you'd generally put in a shell script. I think most of the pro* C usage came from pre Oracle 7 when PL/SQL didn't exist.


EDB PostgreSQL is still very much alive and Oracle compatibility is a big success among enterprises that have chosen to migrate and need to smooth the process.


That was the whole hook for EnterpriseDB. They still sell the product:

https://www.enterprisedb.com/products/edb-enterprise

The difference here is that the EnterpriseDB product is not open source.


IBM Db/2 also bought it, and uses it to implement SQL/PSM.

https://www.enterprisedb.com/resources/ibmr-puts-oracle-swor...


That sounds like the description of a distribution of postgresql to me.

Think of a gnu/linux distro, that gives you some pre-packaged software built with an intended goal (more or less general) and according to a certain set of opinions.


Their Oracle compatibility is still a thing, at least commercially: https://www.enterprisedb.com/products/edb-postgres-advanced-...


Can someone elaborate on what specifically something like this would be used for?

I would imagine if you're going through the pain of migrating off Oracle, picking something like IvorySQL is just a half-measure. Why not just make the switch to PostgreSQL (or other) and be done with worrying about compatibility? How long will this project last, and how great will the compatibility actually be - is it a drop-in replacement?

Most folks use ORM's these days too - making switching databases simple (although not always trivial).

So why does this need to exist?


Full migration can take months if not years. Meanwhile, a drop-in replacement will allow you to stop paying Oracle immediately.

I wouldn't be too optimistic about ORM usage in the kinds of organizations that chose Oracle in the first place.


If you're using an ORM then you're by default using the database fairly generically. I'd ask why you are paying for any commercial DB in that case.

Organizations who committed to and paid for Oracle are probably using a lot of the features that are unique to Oracle. Or they have a lot of legacy that is.

If IvorySQL can take all their custom plsql packages and ETL batch jobs and run them without changes that's a big win. It's not clear to me that it really can do that, though.


> If IvorySQL can take all their custom plsql packages and ETL batch jobs and run them without changes that's a big win.

It's a big win even if it just substantially reduces the transition cost, though being completely drop-in would be even better.


> It's not clear to me that it really can do that, though.

It would seem exceedingly foolhardy to put all your eggs into, what is essentially a compatibility shim layer/plugin, that may or may not actually be compatible with Oracle or all of Oracle.

The company behind it also is an unknown (to me at least) - HiGo[1].

So, IvorySQL is FOSS and free (as in beer) - but what happens if some feature doesn't actually work like advertised? Or something isn't implemented yet? Now you're paying HiGo for support instead of Oracle - although I'd trust Oracle's product a lot more personally.

> I'd ask why you are paying for any commercial DB in that case.

People pay for commercial DB's for a lot of reasons - including having someone to call at 3am when things go bad. Look at how prevalent SQL Server is - most of the deployments I've seen are because the company simply decided they will use SQL Server for everything (ie, not a technical reason).

[1] https://www.highgo.ca/


If you want to use this, you will port your code, run your tests, fix an issue here or there as needed, and develop for Postgres for now on.

None of those steps is particularly risky. If any of the steps that may fail brings an insurmountable obstacle, you ditch the project and go back to where you started.

> People pay for commercial DB's for a lot of reasons - including having someone to call at 3am when things go bad.

Oh, the old support excuse for proprietary software. The Oracle support is excellent, but good hope getting anybody to help you at 3am. Good luck getting anybody to actually help you in less than 24 hours anyway. None of the big proprietary software distributors offer anything like this. Oracle is way ahead of the competition on that they will even actually help... kind like you get when you hire a local company to support Postgres for you.


The scale of your operation and license subscriptions matters for the level of support you receive, naturally.

Big Microsoft shops, like state governments routinely have Microsoft staff fly out and work closely to bring new services online, etc. You cannot expect that level of service if you're just paying for a single database instance, of course.

IBM's support is also legendary - you will get a person on the phone at 3am, and even have a service technician onsite in the morning if needed. Personal experience with this one - they'll fly someone in from out of state to replace a hard drive if it means meeting their service levels.


> you will get a person on the phone at 3am

And that person will do nothing else but waste your time.

What is the natural result of any interaction with Microsoft support too. Not limited to 3am calls.

Anyway, I wonder how RedHat has adapted to the IBM culture. I haven't dealt with software support for a while now, what I'm very grateful for.


Database engine might be the last product one can test and trust open source support wise. For individual it is fine. For company and your whole business is there … at least some paid support is important. It can’t be day to day stuff as you will know. It is some unusual combination which when encounter, you have to pass along your program, setting … can’t do it in open forum I suspect.


Oracle is expensive. Salesforce has been developing something similar internally for years to replace Oracle.


So did Amazon/AWS I think.


The last time I did real work with Oracle and MSSQL, I must have created something like 50 megabytes of "SQL" via stored procedures and such for them. The idea of migrating away from those databases to something with compatible syntax and such would have actually been feasible, but otherwise 100% dead on arrival.

If you could "just switch" then you probably shouldn't be using RDBMS at all.


Because migrating off Oracle to an Oracle-compatible DB is less work than migrating to straight Postgres. This is not rocket science.


'' is NULL in Oracle. The switch is non-trivial.


So correct me if I am mis-understanding...

it has to be in oracle or pg compatibility mode, so effectively its just an oracle api replacement, but should more or less behave like oracle

so the only primary benefit is you stop paying oracle because you just want to leave oracle?

It doesn't exactly let you move away from oracle APIs though.

It is a big win financially. So good on them, I hope it gets all the traction!



But that one is for MS SQL Server, not Oracle


It's postgres, but implementing TDS. It is important to understand that the networking is not the server.

https://en.m.wikipedia.org/wiki/Tabular_Data_Stream

I use freetds in many places.

https://www.freetds.org/

I don't think that the programming language inside Sybase/Microsoft SQL Server, known as Transact-SQL, has been implemented in postgres, but I could be wrong.

https://en.m.wikipedia.org/wiki/Transact-SQL

Microsoft does not implement SQL/PSM in SQL Server. They need to do so. Immediately.


> I don't think that the programming language inside Sybase/Microsoft SQL Server, known as Transact-SQL, has been implemented in postgres

You are wrong; from the Babelfish page: “With Babelfish, Aurora PostgreSQL now understands T-SQL, Microsoft SQL Server's proprietary SQL dialect, and supports the same communications protocol, so your apps that were originally written for SQL Server can now work with Aurora with fewer code changes.”


I presume this still requires the postgres drivers to connect but then just accepts Oracle syntax once connected? That seems like a very specialized replacement case -- where I guess the app has a lot of complex reporting logic or a monster amount of stored procs that can't be changed, but the consuming app(s) can change drivers and exception handling for the PG ones


Wasn't this also possible open-source from AWS's "Babelfish" plugin?


So will this support materialized views? That's a very nice Oracle SQL feature



Not as nice as oracle, oracle provides auto refreshed materialized views that will be updated with every commit.



Isn't that better accomplished as an ordinary view + an index (arguably, an "auto-refreshed materialized" store is an index)? AIUI, Postgres supports indexes on arbitrary expressions.


This has such a huge potential to slay the dragon. Kudos!


This is amazing! Thank you so much for doing this!


Great choice of name and logo.


What’s the point of doing some just for the sake of destroying other people’s business?


Oracle requires a lot of maintenance and is terribly buggy. And the documentation is not always complete.

Postgresql, on the other hand, is dead simple to manage.

It's my dream to move all my Oracle databases to Postgresql.


Did not find any obvious references as to who is backing this project, but it seems to be a Chinese software consultancy. https://www.highgo.ca/

> What’s the point of doing some just for the sake of destroying other people’s business?

Apart from any potential ideological reasons related to open source, they are likely planning to support their own business by providing a compelling product.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: