Running multiple databases PG vs MySQL

Started by Alexabout 22 years ago39 messagesgeneral
Jump to latest
#1Alex
alex@meerkatsoft.com

Hi,
what is the recommended way to run multiple databases under postgres.

In MySQL it is rather simple to give different users or websites their
own database with all the access rights.

Any suggestion or links to documents are highly appreciated.

Alex

#2Frank Finner
postgresql@finner.de
In reply to: Alex (#1)
Re: Running multiple databases PG vs MySQL

On Sun, 28 Mar 2004 14:24:15 +0900 Alex <alex@meerkatsoft.com> sat down, thought long and then
wrote:

Hi,
what is the recommended way to run multiple databases under postgres.

In MySQL it is rather simple to give different users or websites their
own database with all the access rights.

Any suggestion or links to documents are highly appreciated.

Alex

If you call "createdb -?" within a shell you will get the following:

---
createdb creates a PostgreSQL database.

Usage:
createdb [OPTION]... [DBNAME] [DESCRIPTION]

Options:
-D, --location=PATH alternative place to store the database
-E, --encoding=ENCODING encoding for the database
-O, --owner=OWNER database user to own the new database
-T, --template=TEMPLATE template database to copy
-e, --echo show the commands being sent to the server
-q, --quiet don't write any messages
--help show this help, then exit
--version output version information, then exit

Connection options:
-h, --host=HOSTNAME database server host or socket directory
-p, --port=PORT database server port
-U, --username=USERNAME user name to connect as
-W, --password prompt for password

By default, a database with the same name as the current user is created.

Report bugs to <pgsql-bugs@postgresql.org>.
---

So, to create a database from shell, you have to call
"createdb -O <valid database user> <databasename>". You should do this as valid database superuser
who may add databases!

Another way is to connect to template1 as the future owner:
"psql template1 <valid database user>"
and create the database with "CREATE DATABASE <databasename>...". Every valid user may connect to
template1. You don´t need to use psql, this works for example also with PgAdmin, it´s even simpler
because you don´t need to remember the syntax, just click around.

Of course, the <valid database user> must be enabled to create databases, therefore it must have
been created either by calling "createuser -d <valid database user> ..." or with an appropriate SQL
command "CREATE USER <valid database user> ... CREATEDB" by a database superuser, or again with a
tool like PgAdmin.

BTW: Why do so many people comparisons with MySQL syntax during the last days? "MySQL can do this,
in MySQL I can do this that way" and so on. Next time I´ d like to read something like "In DB2 I can
simply add a database by whatever." or "With MS-SQL-Server you just have to do the following 32
steps to create a backup.". :-)

Who cares about how something works in MySQL? They are NOT the providers of a standard everybody has
to use!

Regards, Frank.

#3Alex
alex@meerkatsoft.com
In reply to: Frank Finner (#2)
Re: PG vs MySQL

Frank,
pls. apologize. Maybe my description was not so clear. What I was
referring to was the fact that under MySQL you have more freedom to give
individual users of a shared server rights to create and manage their
databases In addition all databases are kept in separate directories
unlike postgres.

As a server administrator, this make life simpler and you dont need to
worry about other users messing around outside their designated environment.

I guess one reason users compare MySQL with Postgres is that they see
the benefits of postgres and intend to switch or at least look into it,
but at the same time they dont want to compromise when it comes to ease
of use and administration.
MySQL is still the default database offered by any web hosting company
and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease
of setting up Replication. Postgres still is quite far behind there and
for normal users that know MySQL best the transition is probably a too
big step and risk.

But then again, it might not be the aim of postgres to become that no1
open source db and part of every web hosting environment. Instead rather
to be an alternative for the serious databases for corporate use.

Might actually quite interesting to start a discussion on this topic
here :-)

Cheers
Alex

Frank Finner wrote:

Show quoted text

On Sun, 28 Mar 2004 14:24:15 +0900 Alex <alex@meerkatsoft.com> sat down, thought long and then
wrote:

Hi,
what is the recommended way to run multiple databases under postgres.

In MySQL it is rather simple to give different users or websites their
own database with all the access rights.

Any suggestion or links to documents are highly appreciated.

Alex

If you call "createdb -?" within a shell you will get the following:

---
createdb creates a PostgreSQL database.

Usage:
createdb [OPTION]... [DBNAME] [DESCRIPTION]

Options:
-D, --location=PATH alternative place to store the database
-E, --encoding=ENCODING encoding for the database
-O, --owner=OWNER database user to own the new database
-T, --template=TEMPLATE template database to copy
-e, --echo show the commands being sent to the server
-q, --quiet don't write any messages
--help show this help, then exit
--version output version information, then exit

Connection options:
-h, --host=HOSTNAME database server host or socket directory
-p, --port=PORT database server port
-U, --username=USERNAME user name to connect as
-W, --password prompt for password

By default, a database with the same name as the current user is created.

Report bugs to <pgsql-bugs@postgresql.org>.
---

So, to create a database from shell, you have to call
"createdb -O <valid database user> <databasename>". You should do this as valid database superuser
who may add databases!

Another way is to connect to template1 as the future owner:
"psql template1 <valid database user>"
and create the database with "CREATE DATABASE <databasename>...". Every valid user may connect to
template1. You don�t need to use psql, this works for example also with PgAdmin, it�s even simpler
because you don�t need to remember the syntax, just click around.

Of course, the <valid database user> must be enabled to create databases, therefore it must have
been created either by calling "createuser -d <valid database user> ..." or with an appropriate SQL
command "CREATE USER <valid database user> ... CREATEDB" by a database superuser, or again with a
tool like PgAdmin.

BTW: Why do so many people comparisons with MySQL syntax during the last days? "MySQL can do this,
in MySQL I can do this that way" and so on. Next time I� d like to read something like "In DB2 I can
simply add a database by whatever." or "With MS-SQL-Server you just have to do the following 32
steps to create a backup.". :-)

Who cares about how something works in MySQL? They are NOT the providers of a standard everybody has
to use!

Regards, Frank.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

#4The Hermit Hacker
scrappy@hub.org
In reply to: Alex (#3)
Re: PG vs MySQL

On Mon, 29 Mar 2004, Alex wrote:

Frank,
pls. apologize. Maybe my description was not so clear. What I was
referring to was the fact that under MySQL you have more freedom to give
individual users of a shared server rights to create and manage their
databases In addition all databases are kept in separate directories
unlike postgres.

Huh? Each database under PostgreSQL is kept under a seperate directory on
the server ... always has been that way ..

As to the ability to create/manage their own databases .. pls elaborate on
what issues you've had with this under PostgreSQL, as its a simple ALTER
command to provide a user with both CREATE USER and/or CREATE DATABASE
permisisons ...

MySQL is still the default database offered by any web hosting company

No it isn't ... I can name three companies that offer PostgreSQL as a
primary database, and at least one of them only has MySQL as a means to do
migrations ... and those are just the ones that I know personally ...

and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease

Please provide some examples .. I know any attempt I've made to do
adminstrative stuff under MySQL has ended in a headache, but I've been
using PostgreSQL for almost a decade now, so I find PostgreSQL the easier
of the two ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#5Mike Nolan
nolan@gw.tssi.com
In reply to: The Hermit Hacker (#4)
Re: PG vs MySQL

Huh? Each database under PostgreSQL is kept under a seperate directory on
the server ... always has been that way ..

Perhaps, but it isn't obvious which directory has which database. I'm not
not sure which system catalogs provide that information, something that
wasn't obvious from the online docs, either.

As to the ability to create/manage their own databases .. pls elaborate on
what issues you've had with this under PostgreSQL, as its a simple ALTER
command to provide a user with both CREATE USER and/or CREATE DATABASE
permisisons ...

One of the big differences I see from the perspective of the DBA at an
ISP is that MySQL has better user/customer isolation. This means
that customer A should not be able to learn ANYTHING about customer
B's database, not even that it exists.

The \l command should only list databases that the current user is
authorized for, the \du command should only list users authorized for
the current database (and perhaps only superusers should get even that
much information), etc. Perhaps it is possible to set PG to do this,
but that should probably be the default.
--
Mike Nolan

#6The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#5)
Re: PG vs MySQL

On Sun, 28 Mar 2004, Mike Nolan wrote:

Huh? Each database under PostgreSQL is kept under a seperate directory on
the server ... always has been that way ..

Perhaps, but it isn't obvious which directory has which database. I'm not
not sure which system catalogs provide that information, something that
wasn't obvious from the online docs, either.

SELECT oid FROM pg_database WHERE datname = '<database>';

or use the oid2name program that is in contrib ...

The \l command should only list databases that the current user is
authorized for, the \du command should only list users authorized for
the current database (and perhaps only superusers should get even that
much information), etc. Perhaps it is possible to set PG to do this,
but that should probably be the default.

Now, those are good points, and I agree ... only pg-superuse should be
able to see all databases ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#7The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#5)
Re: PG vs MySQL

On Sun, 28 Mar 2004, Mike Nolan wrote:

The \l command should only list databases that the current user is
authorized for, the \du command should only list users authorized for
the current database (and perhaps only superusers should get even that
much information), etc. Perhaps it is possible to set PG to do this,
but that should probably be the default.

Just curious ... restricting \l itself isn't too difficult ... but how
does MySQL restrict the ability to do something like:

SELECT datname FROM pg_database;

or does it not have an equivalent to that?

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#8Uwe C. Schroeder
uwe@oss4u.com
In reply to: Alex (#3)
Re: PG vs MySQL

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 28 March 2004 06:06 pm, Alex wrote:

Frank,
pls. apologize. Maybe my description was not so clear. What I was
referring to was the fact that under MySQL you have more freedom to give
individual users of a shared server rights to create and manage their
databases In addition all databases are kept in separate directories
unlike postgres.

As a server administrator, this make life simpler and you dont need to
worry about other users messing around outside their designated
environment.

Given, MySQL is "easier" to administrate - at least on the first glance. But
so is MS Access :-)
Personally I found the whole access rights table in MySQL a pain in the butt,
but maybe that's just me.
The point is, that MySQL is easier to set up in a shared webhosting
environment, however looking at quite some of the "professional" hosters, one
has full access to everyone's database, so it obviously isn't that easy after
all...

I guess one reason users compare MySQL with Postgres is that they see
the benefits of postgres and intend to switch or at least look into it,
but at the same time they dont want to compromise when it comes to ease
of use and administration.

Severly at the cost of data integrity.

MySQL is still the default database offered by any web hosting company
and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease
of setting up Replication. Postgres still is quite far behind there and
for normal users that know MySQL best the transition is probably a too
big step and risk.

That MySQL is the "default" database for webhosters is most likely the same
reason why Access is the "default" database on Windows boxes: You only need
minimal knowledge to get it running - no matter how flawed the result.

But then again, it might not be the aim of postgres to become that no1
open source db and part of every web hosting environment. Instead rather
to be an alternative for the serious databases for corporate use.

I sincerely hope not. PostgreSQL is THE free database that can reach the
production quality of the major databases (Oracle, DB2). The only remaining
feature it lacks out of the box is replication and some HA abilities the big
ones have. And for that it's really free as in beer and speech. Not a fake
type of hybrid license like MySQL.

Might actually quite interesting to start a discussion on this topic
here :-)

PLEASE: Could anyone set up a "MySQL versus PostgreSQL" mailing list that's
directly routed to /dev/null ? It's really boring to hear the same arguments
over and over again. If you love the "features" of MySQL - feel free to use
it.

Cheers
Alex

Frank Finner wrote:

On Sun, 28 Mar 2004 14:24:15 +0900 Alex <alex@meerkatsoft.com> sat down,
thought long and then

wrote:

Hi,
what is the recommended way to run multiple databases under postgres.

In MySQL it is rather simple to give different users or websites their
own database with all the access rights.

Any suggestion or links to documents are highly appreciated.

Alex

If you call "createdb -?" within a shell you will get the following:

---
createdb creates a PostgreSQL database.

Usage:
createdb [OPTION]... [DBNAME] [DESCRIPTION]

Options:
-D, --location=PATH alternative place to store the database
-E, --encoding=ENCODING encoding for the database
-O, --owner=OWNER database user to own the new database
-T, --template=TEMPLATE template database to copy
-e, --echo show the commands being sent to the server
-q, --quiet don't write any messages
--help show this help, then exit
--version output version information, then exit

Connection options:
-h, --host=HOSTNAME database server host or socket directory
-p, --port=PORT database server port
-U, --username=USERNAME user name to connect as
-W, --password prompt for password

By default, a database with the same name as the current user is created.

Report bugs to <pgsql-bugs@postgresql.org>.
---

So, to create a database from shell, you have to call
"createdb -O <valid database user> <databasename>". You should do this as
valid database superuser who may add databases!

Another way is to connect to template1 as the future owner:
"psql template1 <valid database user>"
and create the database with "CREATE DATABASE <databasename>...". Every
valid user may connect to template1. You don´t need to use psql, this
works for example also with PgAdmin, it´s even simpler because you don´t
need to remember the syntax, just click around.

Of course, the <valid database user> must be enabled to create databases,
therefore it must have been created either by calling "createuser -d
<valid database user> ..." or with an appropriate SQL command "CREATE
USER <valid database user> ... CREATEDB" by a database superuser, or
again with a tool like PgAdmin.

BTW: Why do so many people comparisons with MySQL syntax during the last
days? "MySQL can do this, in MySQL I can do this that way" and so on.
Next time I´ d like to read something like "In DB2 I can simply add a
database by whatever." or "With MS-SQL-Server you just have to do the
following 32 steps to create a backup.". :-)

Who cares about how something works in MySQL? They are NOT the providers
of a standard everybody has to use!

Regards, Frank.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

- --
UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAZ6b5jqGXBvRToM4RAi3aAKCXI8dfL4Kg+ZioKiXIcDc/SG6NXwCfR7kC
Fh8HCkRASFEhvN5RIp1irmU=
=iJCR
-----END PGP SIGNATURE-----

#9Mike Nolan
nolan@gw.tssi.com
In reply to: The Hermit Hacker (#6)
Re: PG vs MySQL

Perhaps, but it isn't obvious which directory has which database. I'm not
not sure which system catalogs provide that information, something that
wasn't obvious from the online docs, either.

SELECT oid FROM pg_database WHERE datname = '<database>';

Thanks. That should be easier to find in the documentation, perhaps it
should be mentioned in the docs for the pg_database system catalog.

From an ISP's or DBA's point of view, it would be preferable if there was
a way to determine which directory held which database without having
to actually log into the database. I can envision circumstances under
which postmaster might not be running when that information is needed.
--
Mike Nolan

#10Mike Nolan
nolan@gw.tssi.com
In reply to: The Hermit Hacker (#7)
Re: PG vs MySQL

Just curious ... restricting \l itself isn't too difficult ... but how
does MySQL restrict the ability to do something like:

SELECT datname FROM pg_database;

or does it not have an equivalent to that?

I'm not much of an expert in MySQL, but on my ISP 'show databases' only
shows MY databases.

I find MySQL's security tables arcane and confusing, but it may be that
I'm just more familiar with the way PG does it, because from the traffic
on the pgsql-general list it seems like questions about how to set up
the pg_hba.conf and pg_ident.conf are commonplace.

I also wonder how well the pg_hba.conf method will scale. What happens
if there are hundreds of client databases or thousands of entries in
pg_hba.conf?
--
Mike Nolan

#11David Garamond
lists@zara.6.isreserved.com
In reply to: Alex (#3)
Re: PG vs MySQL

Alex wrote:

MySQL is still the default database offered by any web hosting company
and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease
of setting up Replication. Postgres still is quite far behind there and
for normal users that know MySQL best the transition is probably a too
big step and risk.

But then again, real admin uses CLI :-)

Trust me, administering PG is not at all harder than MySQL, Apache,
Bind, Qmail, FB, etc. The only extra thing I need to do compared to
MySQL or FB is that I need to run VACUUM from time to time, but that's
so easy to do and autovacuum might be the way of the future anyway.

As to usage, PG is also very easy and convenient to use. Want some proofs?

1) PG's command line client is *much better* than MySQL's.

2) There are lots of webhosting provider offering PostgreSQL.

3) API/binding to virtually any language/environment (I don't think I've
seen .NET Data Provider or Parrot binding for MySQL);

4) LIMIT clause (with nicer syntax), autoincrementing column, easy
BLOB/TEXT, full-text search, replication, etc.? You got it.

But of course, if you're looking for other MySQL "conveniences" such as
silently chopping your string, silently converting your column data
type, allowing entering invalid values in your ENUM column, allowing
invalid dates, allowing breaking FK integrity, etc. then PG does not
have those. But I find them scary anyway :-)

--
dave

#12Pierre Didelon
pdidelon@cea.fr
In reply to: David Garamond (#11)
Re: PG vs MySQL

Hi david and PGSQL lovers,

I think that PGSQL devellopers and users must not be upset
by all the ongoing comparisons between MySQL and PostgreSQL.
This is the direct illustration of the postgresql success,
it gives me the feelings that its like a shameful desire
of MySQL users to come to a more "professional" DB.
It is a "demonstration" of the technical scale in DBMS
Access/MySQL/PostgreSQL (IMHO). Like for every domain in
the common life; if you want to make things better, you need
to do it "harder", but at the same time, depending of your needs,
before trying to do things better (migrating from MySQL to
PostgreSQL) you want to check if the investment is worthwhile.
'cause the last 10% oftently costs 90% of the effort.
So, don't turn the back to people trying to understand
the diff. and simil. between the DBMS, or the pro's and con's.
Explain (as you aleady does) that the 2 systems do not
fullfill the same needs and does not requires the same skill,
like the diff. between Access and MySQL.
Perhaps there is a page on the web which explain that?
I didn't found it, but may be somebody know one!

The probleme is also linked, as can be seen from the amount
of mail on general-psql list, to the fact that MySQL is available
natively on Window (and very easy to install there),
while PostgreSQL not yet, and a lot of people (me included)
are waiting this.

These 2 points explain the wealth of mail on general list and I really
understand that PostgreSQL devellopers, programmers and exclusive users
could be upset by mail avalanche on this subject. So, apart creating
a mailing list for native window users, it could be of some interest to
create a "MySQL migration" list to clear general list. I must admit that
I am incline to unsuscribe, although it is a nice chanel to stay
informed and continue to learn from other users experiences,
but too much information kills information.

All the best to the postgresql team,
Pierre

PS: I hope that my english is understable, and that I didn't hurt
anybody with misunderstandings or mistakes.

David Garamond wrote:

Alex wrote:

MySQL is still the default database offered by any web hosting company
and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease
of setting up Replication. Postgres still is quite far behind there
and for normal users that know MySQL best the transition is probably a
too big step and risk.

But then again, real admin uses CLI :-)

doing this only 24hours per day ;-)

Trust me, administering PG is not at all harder than MySQL, Apache,
Bind, Qmail, FB, etc. The only extra thing I need to do compared to
MySQL or FB is that I need to run VACUUM from time to time, but that's
so easy to do and autovacuum might be the way of the future anyway.

As to usage, PG is also very easy and convenient to use. Want some proofs?

1) PG's command line client is *much better* than MySQL's.

Common basic users love window interface, and even more experienced ones
like them because that are (WI) more "self explanatory", give you an easy
way to use all the possibilities of commands, without having to remember
all the tiny tricks hiden everywhere in corners.

2) There are lots of webhosting provider offering PostgreSQL.

3) API/binding to virtually any language/environment (I don't think I've
seen .NET Data Provider or Parrot binding for MySQL);

4) LIMIT clause (with nicer syntax), autoincrementing column, easy
BLOB/TEXT, full-text search, replication, etc.? You got it.

But of course, if you're looking for other MySQL "conveniences" such as
silently chopping your string, silently converting your column data
type, allowing entering invalid values in your ENUM column, allowing
invalid dates, allowing breaking FK integrity, etc. then PG does not
have those. But I find them scary anyway :-)

These are among the technical advantages of PostgreSQL,
and I experienced somes, introducing weird data in my tables ;-o

--
Pierre
--------------------------------------------------------------------------
DIDELON :@: pdidelon_at_cea.fr Phone : 33 (0)1 69 08 58 89
CEA SACLAY - Service d'Astrophysique 91191 Gif-Sur-Yvette Cedex
--------------------------------------------------------------------------

#13The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#10)
Re: PG vs MySQL

On Sun, 28 Mar 2004, Mike Nolan wrote:

I'm not much of an expert in MySQL, but on my ISP 'show databases' only
shows MY databases.

Right, show databases == \l, I believe ... but, how is security on the
table(s) that 'show databases' dealt with ... can you access those
directly, by passing the "security" on 'show databases'?

I also wonder how well the pg_hba.conf method will scale. What happens
if there are hundreds of client databases or thousands of entries in
pg_hba.conf?

I'd be more concerned with how any server would scale to having thousands
of databases running on it myself ... but, right now, my largest server is
running ~165 databases, servicing 4 physical servers, and the server
itself is still highly responsive. Note that the server that that
database is running on runs two other instances of PostgreSQL (7.2 and
7.4), 2 of MySQL (4.0 and 4.1), one of Firebird and about 25 other
"virtual servers" ... loadavg is generally <2 ...

Only time I've ever really had a problem with it was when we ran
Mnogosearch for the archives ... major dog on resources, since it wasn't
really designed for anything by MySQL ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#14The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#9)
Re: PG vs MySQL

On Sun, 28 Mar 2004, Mike Nolan wrote:

Perhaps, but it isn't obvious which directory has which database. I'm not
not sure which system catalogs provide that information, something that
wasn't obvious from the online docs, either.

SELECT oid FROM pg_database WHERE datname = '<database>';

Thanks. That should be easier to find in the documentation, perhaps it
should be mentioned in the docs for the pg_database system catalog.

From an ISP's or DBA's point of view, it would be preferable if there was
a way to determine which directory held which database without having
to actually log into the database. I can envision circumstances under
which postmaster might not be running when that information is needed.

Two valid points ... I've brought them up onto hackers to see about
getting both rectified ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#15Alex
alex@meerkatsoft.com
In reply to: The Hermit Hacker (#4)
Re: PG vs MySQL

Marc,
I guess we both agree that postgress is in no way as popular with web
hosting companies as MySql (even though you know of 3 such providers
which most likely at the same time also offer MySQL), and I believe with
good reasons as it is more complex than MySQL and most of the
administrators and support stuff are not no dbas either.

I am in no way lobbying for MySQL as I also like to work with Postgres
and have used it for a few years now. It not only saved me and my
clients a lot of money by opting for Postgres instead of Sybase or
Oracle but it is also fun to work with it.

The argument for one or the other probably has been discussed here for
the past 5 years and most likely both dbs will at one point cover the
same functionality or really become specialized for a particular market
segment.

Uwe in a mail mentioned his so called "fake type of hybrid license like
MySQL". I wonder if postgres isn't following the same (natural) path (of
the money).

A

Marc G. Fournier wrote:

Show quoted text

On Mon, 29 Mar 2004, Alex wrote:

Frank,
pls. apologize. Maybe my description was not so clear. What I was
referring to was the fact that under MySQL you have more freedom to give
individual users of a shared server rights to create and manage their
databases In addition all databases are kept in separate directories
unlike postgres.

Huh? Each database under PostgreSQL is kept under a seperate directory on
the server ... always has been that way ..

As to the ability to create/manage their own databases .. pls elaborate on
what issues you've had with this under PostgreSQL, as its a simple ALTER
command to provide a user with both CREATE USER and/or CREATE DATABASE
permisisons ...

MySQL is still the default database offered by any web hosting company

No it isn't ... I can name three companies that offer PostgreSQL as a
primary database, and at least one of them only has MySQL as a means to do
migrations ... and those are just the ones that I know personally ...

and if Postgres wants to become the designated db engine for these
services or become the worlds no.1 open source db then i think lots of
things need to be done. Take for example the admin interface (MySQL
Administrator) for MySQL which is done very professionally or the ease

Please provide some examples .. I know any attempt I've made to do
adminstrative stuff under MySQL has ended in a headache, but I've been
using PostgreSQL for almost a decade now, so I find PostgreSQL the easier
of the two ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#16The Hermit Hacker
scrappy@hub.org
In reply to: Alex (#15)
Re: PG vs MySQL

On Mon, 29 Mar 2004, Alex wrote:

Uwe in a mail mentioned his so called "fake type of hybrid license like
MySQL". I wonder if postgres isn't following the same (natural) path (of
the money).

How so? There are no financial requirements when using PostgreSQL, nor
will there ever be ... there are several *support* companies out there
that you can pay for support, but it isn't a requirement to use either ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#17Uwe C. Schroeder
uwe@oss4u.com
In reply to: The Hermit Hacker (#16)
Re: PG vs MySQL

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 29 March 2004 06:33 am, Marc G. Fournier wrote:

On Mon, 29 Mar 2004, Alex wrote:

Uwe in a mail mentioned his so called "fake type of hybrid license like
MySQL". I wonder if postgres isn't following the same (natural) path (of
the money).

How so? There are no financial requirements when using PostgreSQL, nor
will there ever be ... there are several *support* companies out there
that you can pay for support, but it isn't a requirement to use either ...

The "fake" in MySQL is that, as discussed a thousand times, you can't use it
in any commercial project without buying a license. With MySQL you either use
GPL, or proprietary commercial licenses. Since this includes all client libs
a system like OpenOffice can offer MySQL support, StarOffice basically can't
since it's not under GPL.
I used the work "fake" here because it's pretty much like those "free checking
bank accounts". You have no idea when you will be charged a fee. Since the
legal side of when a license has to be bought for MySQL isn't really clear, I
decided against using or supporting MySQL. This dual policy of "unless it's
100% GPL what you're doing, buy a license" is very hard to follow. Where is
the line of 100% GPL ? Legally my lawyer thinks that MySQL AB could enforce
the "buy a license" if you write a closed source application in PHP. Usually
the GPL ends at the interpreter. However if you write the PHP app to require
MySQL, then you could be busted. Ok, nobody ever heard of someone who was
forced to buy a license for that - but if there is a lot of money in it,
companies suddenly turn around (see SCO vs. IBM and the rest of the world)

So I rather stick with a database that is not only technically superior, but
also guarantees that neither my company, nor any of our cutomers ever has to
pay for the database. They can elect to buy support from us or from any other
company offering PostgreSQL support. But they don't HAVE TO.

UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAaEpOjqGXBvRToM4RAmf0AKDB+FpjDyBjwY3hRDjFRtq5hnjZHgCgqnPP
/ec0r+cobpcltMPPIAtIz/g=
=eCfr
-----END PGP SIGNATURE-----

#18Joshua D. Drake
jd@commandprompt.com
In reply to: Mike Nolan (#10)
Re: PG vs MySQL

I also wonder how well the pg_hba.conf method will scale. What happens
if there are hundreds of client databases or thousands of entries in
pg_hba.conf?

Although I personally would like to see a pg_hba table instead of the
file, I would have to seariously question your implementation if you had
hundreds of databases on a single machine.

If you need separate data spaces for each customer but the application
uses the same schema, use namespaces within a single database.

Sincerely,

Joshua D. Drake

--
Mike Nolan

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
#19Andrew Ayers
aayers@eldocomp.com
In reply to: Joshua D. Drake (#18)
Re: PG vs MySQL

Uwe C. Schroeder wrote:

The "fake" in MySQL is that, as discussed a thousand times, you can't use it
in any commercial project without buying a license. With MySQL you either use

IIRC, isn't this because they don't provide an LGPL interface to the DB,
so that if you use the GPL interface (header files, functions, calls) -
your app basically either has to be GPL or a compatible license?
Although I have heard that they even try to enforce this if you use ODBC
access instead of direct API hits (which I think is a load of bull -
ODBC should be the boundry layer between GPL and non-GPL issues -
however, the direct API thing I can see).

I think part of the problem is that they claim GPL - but their
development environment is highly unlike other GPL projects I have seen
- all the of the code comes from in-house, and while it is GPL'd (and
thus, if someone wanted to, they could fork it), there isn't the
multiple (ie, non MySQL) contributors giving code as GPL, etc - so that
they couldn't have the dual-licensing (in a way, they kinda pre-empted
this).

Or am I wrong?

GPL, or proprietary commercial licenses. Since this includes all client libs
a system like OpenOffice can offer MySQL support, StarOffice basically can't
since it's not under GPL.

Once again - I think they could offer ODBC support, and not break this -
ODBC being the buffer (however, I think MySQL would fight this, though I
believe them to be wrong).

I used the work "fake" here because it's pretty much like those "free checking
bank accounts". You have no idea when you will be charged a fee. Since the
legal side of when a license has to be bought for MySQL isn't really clear, I
decided against using or supporting MySQL. This dual policy of "unless it's
100% GPL what you're doing, buy a license" is very hard to follow. Where is
the line of 100% GPL ? Legally my lawyer thinks that MySQL AB could enforce
the "buy a license" if you write a closed source application in PHP. Usually
the GPL ends at the interpreter. However if you write the PHP app to require
MySQL, then you could be busted. Ok, nobody ever heard of someone who was
forced to buy a license for that - but if there is a lot of money in it,
companies suddenly turn around (see SCO vs. IBM and the rest of the world)

PHP is a very special case - and you are right about the ambiguity. This
is one reason (aside from technical (de)merits) why I don't like MySQL -
the license is not clear at all, and nothing has been settled here.
While PostgreSQL uses a BSD license (personally, I like GPL licenses - I
believe a GPL license in the long run is better than a BSD-like license,
from a code-lifecycle viewpoint), at least they stick with it and it is
very *clear* what the license it, no ambiguities.

So I rather stick with a database that is not only technically superior, but
also guarantees that neither my company, nor any of our cutomers ever has to
pay for the database. They can elect to buy support from us or from any other
company offering PostgreSQL support. But they don't HAVE TO.

Here is why I like the GPL (and I don't want to start a flamewar - some
people like different things - no big deal): "payment" for GPL code is
in the form of more code, and knowledge. The GPL fits really well into a
meritocratic mindset - ie, I give you my code and knowledge, all I
require is that you do the same - so that both of us, and the world,
benefits at large.

In this manner, the product becomes mutually stronger over time, and
eventually it hits a point where no single entity (whether that be an
individual or company) can take the code and fork it without breaking
the license (unless they remove all parts that are not theirs that are
GPL'd). In theory, this keeps the code "available" for future
generations, even if development stops on the code. Whereas, with a BSD
license, another company could fork it, make it better, add proprietary
extensions, not release the code for all of these changes, and make a
huge buck off of it. Say these changes become popular, and people prefer
it over the original? The original gradually withers and dies, the the
proprietary version lives on, secure in its position. At least, that is
the theory - we already have a test of it, though it is anybody's guess
what the outcome will be: Apple's OSX - based on BSD. It may not be the
best test, since Apple is hobbled by their expensive hardware - had OSX
been brought out by Microsoft - hmm...

Now - I know that this interchange of knowledge doesn't put food on the
plate. Personally, I think this is only because people are still stuck
with this idea that physical money actually means something. For some
whack reason, people still don't understand that all the money in the
world is fiat money backed up by nothing (hell, most of it is litterally
bits flying around on the internet and stored in databases - possibly a
lot in PostgreSQL databases!). Basically, they are already consensually
agreeing to use valueless trading tokens. This agreement, and the
relative stability of various countries - are the only thing keeping
this system in place.

So - instead of dollars or euros (fiat tokens) being traded for food,
why couldn't code (still bits, after all) be traded for food (or any
other kind of goods)? It could - nothing could really stop it, except
for the established countries (you couldn't tax such an exchange after
all - I think if people seriously went back to using barter in coutries
using fiat money - the jackboots would really come out).

Well - this train has left its tracks - so I will stop...

Andrew L. Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.

#20The Hermit Hacker
scrappy@hub.org
In reply to: Joshua D. Drake (#18)
Re: PG vs MySQL

On Mon, 29 Mar 2004, Joshua D. Drake wrote:

If you need separate data spaces for each customer but the application
uses the same schema, use namespaces within a single database.

What does that buy you that doing seperate databases doesn't? Either way,
you have one connection per client, and each connection is still going to
open the same number of files to do their work ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664

#21Mike Nolan
nolan@gw.tssi.com
In reply to: Joshua D. Drake (#18)
#22Richard Welty
rwelty@averillpark.net
In reply to: Andrew Ayers (#19)
#23scott.marlowe
scott.marlowe@ihs.com
In reply to: Joshua D. Drake (#18)
#24Tom Lane
tgl@sss.pgh.pa.us
In reply to: scott.marlowe (#23)
#25scott.marlowe
scott.marlowe@ihs.com
In reply to: Tom Lane (#24)
#26Mike Nolan
nolan@gw.tssi.com
In reply to: scott.marlowe (#23)
#27Tom Lane
tgl@sss.pgh.pa.us
In reply to: scott.marlowe (#25)
#28Jan Wieck
JanWieck@Yahoo.com
In reply to: Alex (#3)
#29scott.marlowe
scott.marlowe@ihs.com
In reply to: Tom Lane (#27)
#30CSN
cool_screen_name90001@yahoo.com
In reply to: scott.marlowe (#29)
#31The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#21)
#32The Hermit Hacker
scrappy@hub.org
In reply to: Tom Lane (#24)
#33Mike Nolan
nolan@gw.tssi.com
In reply to: The Hermit Hacker (#31)
#34The Hermit Hacker
scrappy@hub.org
In reply to: Mike Nolan (#33)
#35Andrew Rawnsley
ronz@ravensfield.com
In reply to: The Hermit Hacker (#34)
#36Gregory Wood
gwood@ewebengine.com
In reply to: Jan Wieck (#28)
#37Lincoln Yeoh
lyeoh@pop.jaring.my
In reply to: Mike Nolan (#33)
#38Jan Wieck
JanWieck@Yahoo.com
In reply to: Gregory Wood (#36)
#39Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#24)