News for hackers. Stuff that matters.
Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by johannes1234321 on Saturday October 17, 2020 @06:39PM (#24814005)
One can argue about the statement that PostgreSQL is more feature rich.

MySQL has more replication features, different storage engines, etc. also in MySQL GIS functionality is included and not an external plugin (like PostGIS)

The source tree you looked at probably also has ndb cluster included; if you cloned from GitHub, you also get the MySQL Router and other side components.

MySQL also bundles most external dependencies (excluding for example boost)

Any serious discussion would require deeper analysis.

P.S. I work on the MySQL team, never looked at pgsql source, so can't really judge.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by abernard1 on Saturday October 17, 2020 @07:46PM (#24814385)
> MySQL also bundles most external dependencies (excluding for example boost)

This is a great callout. Most people running PG for serious production probably need pgbouncer which looks like it adds 35-50K lines. There's probably a few more 50K-ish plugins that are must haves for serious usage.

I don't know how many lines NDB is, but the lack of a standard failover mechanism and cluster manager in Postgres is a pain. The number of effective lines that the bespoke systems people build for that purpose is probably quite large.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by 5Qn8mNbc2FNCiVV on Sunday October 18, 2020 @06:29PM (#24821633)
Can you give some recommendations for must have plugins? I have a few Postgres databases running in production and none is more than the default docker image from Docker Hub
Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by ksec on Sunday October 18, 2020 @11:01AM (#24818307)
>One can argue about the statement that PostgreSQL is more feature rich.

I dont even think it should be an argument. Postgre by default, on itself without extension is anything but feature rich, especially when comparing to MySQL.

I like Postgre, and I know lots of people on HN do too, and I also know these same people absolutely hate oracle. But come on.

Sometimes these Hype and cult is just a little too much.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by eyelidlessness on Sunday October 18, 2020 @12:18PM (#24818924)
Why the weird misspelling?
Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by redis_mlc on Saturday October 17, 2020 @07:06PM (#24814141)
If you're a developer, a database is just a database.

If you're a corporate DBA, they are each worlds apart.

MySQL is a perfect match for most SaaS applications that deal with compliance. Postgres is simply not.

The main issues with managing Postgres today are grant inheritance, and also the lack of COPY FROM/TO grants. I shouldn't have to update grants for non-admin or readonly users after adding new objects, and there needs to be the equivalent of MySQL's FILE grant for Postgres' COPY FROM/TO.

OTOH, it is easy to reason about MySQL grants, and almost pain-free to update them in production.

If anybody can send me a link on how to make Postgres work in a corporate and/or compliance environment, let me know.

Source: DBA.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by abernard1 on Saturday October 17, 2020 @07:25PM (#24814244)
> MySQL is a perfect match for most SaaS applications that deal with compliance. Postgres is simply not.

I find this statement amazingly weird. In my experience, MySQL's access grants are extremely impoverished compared to Postgres (even in 8). It doesn't have row level security either.

> The main issues with managing Postgres today are grant inheritance

roles + `INHERIT` (which has been available since at least 8.1, 15 years ago)

> I shouldn't have to update grants for non-admin or readonly users after adding new objects

You don't. There are default grants that apply on object creation within a schema: `ALTER DEFAULT PRIVILEGES`.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by redis_mlc on Saturday October 17, 2020 @08:10PM (#24814544)
The reality is that I commonly see MySQL production applications use non-admin accounts, and have never seen that for Postgres. So there is a problem.

Can you see if there is a grant similar to MySQL's FILE for COPY FROM/TO in Postgres? The last time I checked in early 2019, there wasn't.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by justinjlynn on Saturday October 17, 2020 @07:31PM (#24814283)
sigh

Must you really draw conclusions about the suitability of PostgreSQL or MySQL for all users based on your limited perspective/niche needs?

> If you're a developer, a database is just a database.

[screams internally]

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by quickthrower2 on Saturday October 17, 2020 @08:06PM (#24814518)
Yeah I mean as a developer I’ve never had the luxury to ignore storage concerns.

At bigger companies they might abstract it out but your gonna get a slow query one day and be tuning sql or something.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by redis_mlc on Saturday October 17, 2020 @10:34PM (#24815106)
> I’ve never had the luxury to ignore storage concerns

You're way out of date.

There's no storage concerns with the default since 2010 in MySQL, Innodb:

https://en.wikipedia.org/wiki/InnoDB

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by thinkx on Saturday October 17, 2020 @07:15PM (#24814192)
> MySQL is a perfect match for most SaaS applications that deal with compliance. Postgres is simply not.

Please elaborate on this “simply not”.. you are making a categorical statement.. does there exist a DISA-certified STIG for MySQL, for DoD and military applications?

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by mgauto on Saturday October 17, 2020 @07:28PM (#24814267)
There is no certified MySQL STIG yet. There is one for Postgres though.

STIGs are hardening guidelines used the US Department of Defense.

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by johannes1234321 on Saturday October 17, 2020 @07:21PM (#24814219)
I don't know what DISA or STIG are, but yes there are such projects. https://www.mysql.com/customers/industry/?id=65 has a few relevant references.
Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by jlgaddis on Saturday October 17, 2020 @07:39PM (#24814340)
There isn't a STIG for MySQL... yet. Supposedly there is one being worked on, however.

There's been a Postgres STIG for, I dunno, "a while" now.

--

DISA: https://en.wikipedia.org/wiki/Defense_Information_Systems_Ag...

STIG: https://en.wikipedia.org/wiki/Security_Technical_Implementat...

Re:Ask HN: How PostgreSQL source code is 3x shorter than MyS... by x87678r on Saturday October 17, 2020 @08:44PM (#24814731)
I used to think this. I was surprised when DHH said hey.com uses MqSQL as back end. https://twitter.com/dhh/status/1275901955995385856