Forum Moderators: open
Why is that?
Wich one is better and why?
Or wich one is better in what area?
Should I switch?
To make the question simple:
What are the pro's and cons for mysql en postgresql?
Also, the old conventional wisdom is that mysql is faster per query but postgresql holds up better under a higher load. Not sure if that distinction still exists.
I tend to see postgresql as a more "serious" database, and to be honest I rather like it. But mysql is so standard on most hosting packages that I just use it for the simple things I've needed to do, and haven't had a problem. I haven't bothered to explore the differences in a long time because I haven't had the need.
I have to conclude that postgres is a little more mature. Not that mySQL isn't working properly, it's just that postgres seems to be a little more quality.
It seems indeed that postgres is also a little slower then mysql, but I haven't tested that yet properly. Could also be that my php-code is a bit slower for other reasons.
I'm using phppgadmin as a interface with postgres, the user interface of that could be greatly improved, several actions don't feel intuitive.
Also, a question for postgres-users:
What is better practice in postgres:
- use the oid as the key of a records, since that allready is unique.
- use a sequence in combination with an integer field.
I think the latter, as in phppgadmin it seems not possible to make "oid" a primary key...
By default, tables in PostgreSQL 8.0 and earlier are created with OIDs. In the next release, this will not be the case: to create a table that contains OIDs, the WITH OIDS clause must be specified or the default_with_oids configuration parameter must be set. Users are encouraged to explicitly specify WITH OIDS if their tables require OIDs for compatibility with future releases of PostgreSQL.
Not sure if this is a correct place to ask this, but here goes.
What would be the best method to get the primary key of a record that was just inserted using an insert-query, when working with PHP.
I'm currently doing it like this.
Table has OIDS and a field `id` with a sequence.
I run the insert query.
use the function pg_last_oid() to get the oid.
run a select-query with the oid in the where-condition to fetch the field `id`.
Or is there some other method that is better practice?
tnx :)