Hacker News new | past | comments | ask | show | jobs | submit | staticlibs's comments login

Chasing memory leaks in BCP [1] data load implementation in Babelfish [2]. Spotted unusually high RAM usage, decided to look deeper and got into a rabbit hole. Haven't had this fun of overnight debugging (of Postgres guts) for a long time. As a result found 4 different leaks and one (unlikely to be triggered) crash. And now have BCP data load impl with 100% constant-bounded RAM usage in a DB server process.

[1] https://learn.microsoft.com/en-us/sql/tools/bcp-utility?view... [2] https://babelfishpg.org/


Transact-SQL support (both queries and stored procedures) for PostgreSQL is implemented in Babelfish extensions [1]. It is implemented from the ground up as a "pl/tsql" language for Postgres [2], without using SQL-to-SQL transpilation like JOOQ.

[1] https://babelfishpg.org/ [2] https://github.com/babelfish-for-postgresql/babelfish_extens...


What is cool about Postgres extensions ecosystem, is that new functionality can be built upon existing extensions. For example, Babelfish (SQL Server compatibility layer for Postgres) uses pg_hint_plan to implement Transact-SQL hints support [1]. This is really useful, because existing queries, that were optimized for MSSQL, may require tuning when moved to Postgres/Babelfish, and it is great to have additional knobs for tuning.

[1] https://github.com/babelfish-for-postgresql/babelfish-for-po...


None of major Java/OpenJDK contributors (Oracle, Red Hat, SAP etc) care about desktop GUI Java libs. Jet Brains do care, but they are not major. All Java progress is concentrated on backend cloud services for 10-15 years already. This can explain why Swing is so underdeveloped and JavaFX was thrown away. Basically much more effort is required to make Java GUI look and behave nicely, comparing to Delphi/Lazarus or .NET GUI libs or Qt.


Swing underdeveloped? You have been misinformed. The entire JetBrains suite is built in Swing and is top of the line. Swing is under active development, has a strong third party ecosystem, and is rock solid. You can do anything you want to do in Swing, and it is a joy to develop with (unlike any/all of the web front end nightmares).

What .NET GUI libraries are you referring to because anything other than WPF is tetering on "not a good idea." Have you built anything in Swing, WPF, Winforms, Xamarin Forms, or MAUI? You should give them all a serious test drive and get back to us with some informed comments.


I just had to pick up and build a UI product in java recently and picked up javafx for the first time. With Kotlin, I actually found it while using my the standard you builder to be quite intuitive and sorta dynamic enough to make development snappy. Definitely the best attempt at GUIs for java, but sad that only smaller shops are actually investing any real effort into the space. Oh and java native + javafx is a pain in the ass until I discovered Bellsoft NDK, which made building a binary from source 100% so much easier.


DataGrip does look visually better than Dbeaver, but I've found Dbeaver has much better performance.


I'm ignorant about this all. Can't you use something like Qt in Java?


You can, but anything in java that needs to step down into c/c++ ends up being a major pain in the ass so it's usually implemented half baked at best. Platform ergonomics are hard and you usually find that what works great in some languages / paradigms just don't flourish in others. It'd be nice to see some good language bindings that feel right for java.


There are Qt bindings for Java, but I’m not familiar with them


Jet Brains care? Do they? In my experience their tools are some of the ugliest out there. Granted, that's highly subjective, but there is "something" off about IntelliJ that I can't really put my finger on. Maybe the lack of whitespace. Maybe the weird tabs.


I meant that Jet Brains do care about GUI support in OpenJDK (mainstream Java), their flagship products depend on this, they employ a number of ex-Oracle GUI devs and contribute fixes upstream. Just there are no new major projects in GUI area in OpenJDK for years, because none of big contributors is interested in it. Compare this to improvements in non-GUI areas like Java 21 Threading and also the whole Graal thing.


Oh I see, I misunderstood what you meant, thanks for clearing that up.

There was a talk [1] at Devoxx 2023 by an Oracle which gave an overview of the current state of the UI ecosystem, and it wasn't too bad, though it seems like it's mainly JavaFX these days. Support for fractional zooming on HiDPI screens on Linux is still shit, unfortunately, which is something that drives me nuts.

[1] https://www.youtube.com/watch?v=Afehjldx4yM


DBeaver uses SWT toolkit, its widgets are as platform-native as Java can do. Some of them can be much faster with long text editing than default Java Swing widgets.


Yup, SWT is a wrapper for actual native widgets, similar to wxWidgets. Some widgets are custom though, like the horrendously ugly tab widgets, which might be what the other commenter is reacting to. And the spacing and alignment usually doesn't look great in most SWT-based apps I've seen, for some reason.


At least on Apple platforms, I don’t think SWT uses Apple’s layout algorithms and so you end up with Cocoa controls with slightly wrong spacing


DBeaver works surprisingly nicely with less popular DBs. I work with Babelfish for PostgreSQL [1], it supports connections with SQL Server client libs. Most GUI client tools (like SSMS) expect "real" SQL Server on the other end of the wire - depend on various system views for DB introspection, so only partially work with Babelfish. Even if client tool is based on JDBC (like SQuirell SQL), it doesn't guarantee that this tool won't use additional SQL Server-specific queries for introspection. DBeaver is much better at this, I guess it is using JDBC API or DB-neutral INFORMATION_SCHEMA views for introspection.

[1] https://babelfishpg.org/


I personally like the ER diagram viewer in DBeaver. On a project with very little documentation, it was extremely pleasing to point it to the staging database and be able to visualize the relationships between various entities.


SchemaSpy can generate static docs based on a live db, and they include pretty good ER diagrams (IMO).

They have a sample on their website (go to the relationships section):

https://schemaspy.org/samples/epivirusurf/

The convenience factor is that you don't need a continuous connection to the db to refer to the diagrams or other docs.


The free version supports a few, but you need to pay $500 a year if you to talk to more databases or want security or cloud features:

https://dbeaver.com/edition/

It's a great tool, though, a bit buggy but most useful.


In what way is the free version lacking security?


They do use JDBC and even allow you to customize your choice of driver version for a db. It is a bit clunky when one has to resolve missing dependencies but that's just how it works I guess.


Feature set of Postgres on AWS in the article omits Babelfish feature. It is definitely worth mentioning, at least for some unfortunate people who are stuck with SQL Server, but would like to use Postgres as all others do. When you can use BCP or OPENQUERY to move your data to Postgres, instead of COPY - this can make a big difference for some of us.


> WARNING: Files not signed! I don't have a Google Inc. private key at the moment.

Its readme is worth reading.


> moving some data from SQL Server to Postgres

I don't have any first-hand experience with Postgres replication to share, just, when moving DB from MSSQL, Babelfish extensions for Postgres (https://babelfishpg.org/) may be of interest.


Project author here, just noticed that someone submitted this on HN. Thanks for your comment, I didn't thought about this. I wonder what would be a proper way to cover "who is behind"? Perhaps will add some kind of note to the bottom of the web page, something like: "WiltonDB Software founder previously worked on OpenJDK maintenance and packaging at Red Hat".

To clarify, this is a single-person effort, it took about a year to bring the project to current state. Though with current packaging setup (for Windows and Linux) future updates are expected to be smooth. Most of the efforts now are around the tooling like backup/restore.


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

Search: