Live data from Hacker News

Prolog language for PostgreSQL proof of concept

github.com

31–40 of 83 posts

Re: Prolog language for PostgreSQL proof of concept

#31
post #28

Earlier quoted context omitted.

The same applies to those that think Postgres does everything, every single feature, that Oracle, SQL Server, DB 2, and co, are able to deliver, in projects where their license costs are kind of irrelevant in the big context of the organization. Usually, it is a great way for many organizations to have a database as free beer.

Sure, a few organizations may actually need some obscure feature that Oracle provides, but again, it's niche. For most companies, Postgres provides way more features than they will ever use. And for the other 1%, it sometimes happens that their need for a specific feature in Oracle DB turns out to be entirely unnecessary. Not to mention that the vast majority of products turn out to be fancy CRUD apps. Doesn't matter…

There’s one thing Postgres doesn’t provide. It doesn’t provide a supplier who a company can put their liability on. A supplier who can fix the problem in Postgres code and maintain it with authority.

But don’t get me wrong. Postgres is an awesome database system.

Re: Prolog language for PostgreSQL proof of concept

#32
post #21

Earlier quoted context omitted.

All enterprise level RDMS have similar capabilities, some of which are yet to come to Postgres.

Postgres is currently the most advanced RDMS, anyone who's not locked in by Oracle or whatever and doesn't use Postgres for new projects is likely misinformed. Postgres essentially made every other RDMS obsolete except for some niche circumstantial cases (e.g. vendor lock-in) > enterprise level Postgres is enterprise level (whatever that means). Blazingly fast, Web 3, cloud-native, etc etc, pick your own buzzwords

You haven't mentioned support. As much as I'm a fan of Postgres, if my org doesn't have a Postgres support capability, but it does have a MSSQL team, then I'm going to stick with MSSQL.

I've got software to write, I don't want to find out that script I copied from stackoverflow to backup the database doesn't work in all the scenarios I thought it would because something changed a minor version ago.

Re: Prolog language for PostgreSQL proof of concept

#33
post #15

Love this, I've long considered that this should've been made as Prolog and SQL are ternary logic and basically SQL derives from Datalog and it itself from Prolog. A table record can be taught as of as a Prolog fact, so this makes the WHERE clauses the predicates in the conjunction on the right-hand side of a rule. And then exhausting the goal is actually returning the result-set. Hope to see this develop even furthe…

Prolog's evaluation semantics are order-dependent, though. I've always thought this was the reason why the two language paradigms didn't see more merging than they did. There are some datalog+RDBMS hybrids but, as much as I'm not a fan of .NET, I think LINQ has seen the most success in this space.

Re: Prolog language for PostgreSQL proof of concept

#34
post #28

Earlier quoted context omitted.

The same applies to those that think Postgres does everything, every single feature, that Oracle, SQL Server, DB 2, and co, are able to deliver, in projects where their license costs are kind of irrelevant in the big context of the organization. Usually, it is a great way for many organizations to have a database as free beer.

Sure, a few organizations may actually need some obscure feature that Oracle provides, but again, it's niche. For most companies, Postgres provides way more features than they will ever use. And for the other 1%, it sometimes happens that their need for a specific feature in Oracle DB turns out to be entirely unnecessary. Not to mention that the vast majority of products turn out to be fancy CRUD apps. Doesn't matter…

The main enterprise-necessary feature missing in Postgres compared to Oracle is free trips to the Bahamas.

Re: Prolog language for PostgreSQL proof of concept

#35

Earlier quoted context omitted.

Sure, a few organizations may actually need some obscure feature that Oracle provides, but again, it's niche. For most companies, Postgres provides way more features than they will ever use. And for the other 1%, it sometimes happens that their need for a specific feature in Oracle DB turns out to be entirely unnecessary. Not to mention that the vast majority of products turn out to be fancy CRUD apps. Doesn't matter…

There’s one thing Postgres doesn’t provide. It doesn’t provide a supplier who a company can put their liability on. A supplier who can fix the problem in Postgres code and maintain it with authority. But don’t get me wrong. Postgres is an awesome database system.

i beg to differ: Professional Services

https://www.postgresql.org/support/professional_support/

Re: Prolog language for PostgreSQL proof of concept

#36

Earlier quoted context omitted.

Sure, a few organizations may actually need some obscure feature that Oracle provides, but again, it's niche. For most companies, Postgres provides way more features than they will ever use. And for the other 1%, it sometimes happens that their need for a specific feature in Oracle DB turns out to be entirely unnecessary. Not to mention that the vast majority of products turn out to be fancy CRUD apps. Doesn't matter…

There’s one thing Postgres doesn’t provide. It doesn’t provide a supplier who a company can put their liability on. A supplier who can fix the problem in Postgres code and maintain it with authority. But don’t get me wrong. Postgres is an awesome database system.

What does 'put their liability on' mean to you?

Because I suspect it does not mean what I think you think it means.

(Typically the EULA of all those non-Postgres systems are 'this is sold as is, no warranty as to suitability to your purpose, yada yada'

Often times people believe that if they're paying many monies for a support contract, that means they can relocate their liability to that company. Almost every time, that company has better lawyers / contract writers.

Re: Prolog language for PostgreSQL proof of concept

#37

As a proof of concept, this looks very cool. Suggestion: add a short example to the README. I had one experience with Prolog in the 1980s that blew my mind. I had an IR&D project to build a complete prototype of an air/land battle simulator (yes, I was a defense contractor back then) in Common Lisp given 6 weeks of coverage to write it and demo it. After a month I was satisfied with the functionality and after demoin…

Can you explain a little about why / how you modeled a battle simulation in Prolog? To me, the most natural approach is simply a time-stepped battlespace model. With event uncertainty (e.g., did the bullet hit its target?) modeled as random draws that get baked into the outcome.

Honestly, that was almost 40 years ago and the details escape me. I do remember that it was not a fine detail model. I think some ‘experts’ in my company wrote up how they solved certain problems and I tried to capture that. I might have used OPS5 in the Common Lisp prototype. I (in hindsight) wasted a lot of time back then on symbolic AI that didn’t scale, and not enough time with neural networks. I was on a DARPA neural network advisory panel in the mid 1980s and I had a few good wins using NNs.

Re: Prolog language for PostgreSQL proof of concept

#38
post #16

Postgres is not just a relational db. It's a way of life. JSONB, HSTORE, LTREE, Full Text Search, Logical Replication, Range Types, BRIN Indexes, GIN Indexes, GiST Indexes, SP-GiST Indexes, Table Inheritance, Foreign Data Wrappers, XML Support, UUID-OSSP, pg_trgm, Cube, Earthdistance, pg_prolog, pg_partman, pgvector, TimescaleDB, PostGIS, Citus, pg_cron, BDR (Bi-Directional Replication), PL/Python, PL/Java, PL/V8, pg…

[deleted]

Re: Prolog language for PostgreSQL proof of concept

#39

Earlier quoted context omitted.

There’s one thing Postgres doesn’t provide. It doesn’t provide a supplier who a company can put their liability on. A supplier who can fix the problem in Postgres code and maintain it with authority. But don’t get me wrong. Postgres is an awesome database system.

i beg to differ: Professional Services https://www.postgresql.org/support/professional_support/

SQLite has this as well, although it's use cases are different: https://sqlite.org/com/member.html

They have multiple tiers of support as well, pretty interesting read

Re: Prolog language for PostgreSQL proof of concept

#40

When I saw the title I hopes this would be schema aware. Looking into the current proof of concept they allow to write prolog definitions. How cool would be be, if all relations in a Postgres database would be lifted into the scope of a prolog process to work directly on the relations.

If your entire database can be lifted into the application's heap, it's probably small enough that I wonder why you've got it stored in an RDBMS... and because Prolog is lexically sensitive (order of sentences and the order of clauses in the sentence affect the eval result) then you would need to effectively load all related DB entries -- or maybe some cursor tricks to load domain entries lazily and the many small qu…

> If your entire database can be lifted into the application's heap, it's probably small enough that I wonder why you've got it stored in an RDBMS

I think he meant lifting the database schema, not the whole database. This would help with auto completion and other static checks before trying to run queries.

Post reply on HN