TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Babelfish: SQL Server-to-Postgres Translation Layer

288 pointsby ke4qqqover 4 years ago

17 comments

etaioinshrdluover 4 years ago
Don&#x27;t hate me for it, but I&#x27;d like this for MySQL to postgres too. At least as a stepping stone.<p>Use case: some of my SQL syntax depends on MySQL but I realize I made a poor life choice and would rather have transactional DDL and a myriad of better features on postgres.
评论 #25271093 未加载
评论 #25268728 未加载
评论 #25269173 未加载
评论 #25271836 未加载
评论 #25269057 未加载
评论 #25270880 未加载
评论 #25272129 未加载
评论 #25270405 未加载
评论 #25268481 未加载
评论 #25269765 未加载
joshuaellingerover 4 years ago
This is great. I suspect that I have exactly the right use case for this.<p>The two main issues with running SQL Server are (1) you have to license all the cores on a system and (2) the standard license only recognizes up to 64GB RAM. So I actually wound up buying a 3GHz single-socket system for around $10K to save $20K on the SQL license.<p>With this, I can move a couple of the big DBs to another system that has 32 Cores with 256GB RAM and the entire DB will fit in memory, put in 5GB ethernet, and gain a tremendous amount of performance.<p>But, more importantly, I can migrate the workload on a case-by-case basis. Human costs always dwarf my software and hardware costs.
评论 #25269972 未加载
评论 #25273134 未加载
orfover 4 years ago
&gt; A commonly used datatype to store monetary values is the MONEY data type. In SQL Server, the MONEY data type’s behavior is fixed using four digits to the right of the decimal (e.g., $12.8123). However, in PostgreSQL, the MONEY data type is fixed using two digits to the right of the decimal.<p>&gt; So, when the application tries to store a value of $12.8123, by example, PostgreSQL will round to $12.81. This subtle difference will result in a rounding error and break an application if not correctly addressed. To ensure correctness in Babelfish, we need to ensure such differences, small and large, are handled with absolute fidelity.<p>How are they going to solve this with just a query translation layer? Isn&#x27;t information lost on save?
评论 #25270972 未加载
评论 #25270959 未加载
评论 #25272169 未加载
评论 #25270966 未加载
评论 #25270955 未加载
评论 #25270991 未加载
bdcravensover 4 years ago
As someone who has been fighting with a SQL Server to Postgresql conversion this sounds AMAZING. Too bad it won&#x27;t be available before my conversion is complete (and if it is, that&#x27;s an even sadder proposition)
评论 #25272431 未加载
评论 #25268893 未加载
PeterZaitsevover 4 years ago
This would be even greater news if it would not be vaporware &quot;Babelfish for PostgreSQL will be available on Github in 2021.&quot; <a href="https:&#x2F;&#x2F;babelfish-for-postgresql.github.io&#x2F;babelfish-for-postgresql&#x2F;" rel="nofollow">https:&#x2F;&#x2F;babelfish-for-postgresql.github.io&#x2F;babelfish-for-pos...</a>
xupybdover 4 years ago
I hope this means I can finally connect postgres to excel with the same ease I can connect SQL server.
评论 #25268749 未加载
linuxhikerover 4 years ago
This is interesting because it will also help Sybase migrations. SQL Server is the &quot;brand name&quot; but there are still a lot of people stuck on Sybase.
评论 #25269197 未加载
评论 #25271118 未加载
beoberhaover 4 years ago
Sounds like they’re open sourcing it to get some help on it. I have to wonder if they’ve found it not worth the time to make it fully production ready.
评论 #25267486 未加载
评论 #25268569 未加载
评论 #25267494 未加载
评论 #25271092 未加载
justizinover 4 years ago
i swear the fuck to god if one more piece of technology is called babelfish i am going to find out who is responsible and toilet paper their house.
评论 #25271116 未加载
评论 #25271008 未加载
temp667over 4 years ago
Why not do this for Oracle? I&#x27;ve not found SQL Server to be too bad from the crazy Oracle stuff (light experience only - maybe bigger players have it worse?).
评论 #25268409 未加载
评论 #25271726 未加载
评论 #25268178 未加载
评论 #25268307 未加载
评论 #25269276 未加载
edoceoover 4 years ago
Heres ms2pg <a href="https:&#x2F;&#x2F;edoceo.com&#x2F;dev&#x2F;ms2pg" rel="nofollow">https:&#x2F;&#x2F;edoceo.com&#x2F;dev&#x2F;ms2pg</a><p>A tool I made and used over a decade ago when migrating a bunch of stuff
kentbrewover 4 years ago
Ancient muscle memory completes the URL thusly:<p>babelfish.altavista.digital.com
statictypeover 4 years ago
I tried to build a T-Sql-to-pgsql compiler to enable us to migrate our code but ran into some fundamental issues.<p>Sql Server allows you to have arbitrary statements&#x2F;declarations embedded in your sql queries. It also doesn&#x27;t require type information to be specified in many places.<p>How does this translator get around that?<p>For example, if I have this bit of unoptimized T-Sql:<p><pre><code> declare @m int select @m=[MeterID] from EnergyMeters where MeterLocation=&#x27;&#x2F;a&#x2F;b&#x2F;c&#x27;; select sum([Value]) from EnergyData where [MeterID]=@m; </code></pre> How would this get translated to pgsql? (Yes, you can combine this specific statement into a single query - this is a trivial example to highlight the point)
评论 #25272554 未加载
statictypeover 4 years ago
This sounds like it could be a massive competitive advantage for AWS over Azure.<p>It would be difficult for Microsoft to canibalize their Azure Sql sales by building a similar translation layer.
fellowniusmonkover 4 years ago
About every 3 years when I&#x27;ve tried to migrate and use some db migration tool it always seems to throw frustrating string&#x2F;formatting errors, each time I&#x27;ve smacked my forehead and ended up just grabbing Ruby and ActiveRecord, it just always seems to work without any weird parsing errors.
xet7over 4 years ago
1) Is there MongoDB-to-Postgres Translation layer?<p>2) Is there converter that can convert schema and transfer all data from:<p>2.1) MongoDB to SQLite?<p>2.2) MongoDB to PostgreSQL?
评论 #25273139 未加载
conroyover 4 years ago
Any idea what language it’s written in?
评论 #25268391 未加载