4 ms·
The security settings that allow you to even connect are 1) hard to find, 2) somewhat difficult to track down documentation for, and 3) not what everyone would
by sabat 17y ago
The security settings that allow you to even connect are 1) hard to find, 2) somewhat difficult to track down documentation for, and 3) not what everyone would call "reasonable". I like Postgres, but it needs to evolve a more admin-centric attitude in my estimation.
- moe 17y agoExcuse me? http://www.postgresql.org/docs/8.4/static/index.html http://www.postgresql.org/docs/8.4/static/index.html If it takes you more than 10 seconds to find "Client authentication" under "Server administration" then do you really think you are qualified to setup a database server? Sorry if this comes across rude, but criticizing security in postgres in a comparison against MySQL is beyond absurd. The grant-system in MySQL is a bloody mess. It doesn't even have Roles. And it is prone to "funny" side-effects, such as the dreaded anonymous user issue which afaik is still unfixed in latest stable. In a nutshell: If you don't remove the two anonymous user grants that mysql puts in there by default then a grant to 'foo'@'%' will allow 'foo' to connect from any host except localhost. Makes sense? Not? Thought so. Here's why: The connection attempt from localhost is rejected because the default entry ''@'localhost' matches before your 'foo'@'%' entry. So that's what we call admin-centric these days, shipping with mousetraps like that in the default config? http://dev.mysql.com/doc/refman/5.0/en/connection-access.html http://dev.mysql.com/doc/refman/5.0/en/connection-access.htm... Then there's postgres, look how hard it is: First you specify what users are allowed to connect from where and to which databases (pg_hba.conf). Then you create the actual users (CREATE USER). Finally you grant privileges to them (GRANT). Optionally you can group them under roles. The common setup that allows local users to connect without a password as any user but demands a password from remote connections takes all of two lines in pg_hba.conf: # TYPE DATABASE USER CIDR-ADDRESS METHOD host all all 0.0.0.0/0 md5 local all all trust Then you can make your users: CREATE USER foo WITH PASSWORD 'secret'; And give them access to stuff: GRANT ... TO foo; Man that was hard. I'm all exhausted now. But hey, it's right there in the docs. With examples and all. http://www.postgresql.org/docs/8.4/static/auth-pg-hba-conf.html http://www.postgresql.org/docs/8.4/static/auth-pg-hba-conf.h...
- sabat 17y agoRight, so if you want to connect over the network? What happens? Oh, yeah -- it doesn't work. And then you have google and google with no real idea of what keywords to use other than 'postgres connection problem' until you find the arcane configuration that lets you connect. Real simple. Yeah.
- moe 17y agoHave you ever looked at the postgres documentation at all?