I am contemplating a switch from MySQL to PostgreSQL.
What are your tips, tricks and gotchas for working with PostgreSQL?
What should a MySQLer look out for?
See also: How different is PostgreSQL to MySQL?
See also: Migrate from MySQL to PostgreSQL
Note - I don't think this is a duplicate. In particular the type of answers are quite diffferent and the responses here have much more implementation detail, which is what I was looking for
Postgres offers a wider variety of data types than MySQL. If your application deals with any of the unique data types it has available, or unstructured data, PostgreSQL may be a better pick. If you're using only basic character and numeric data types, both databases will suit you.
PostgreSQL supports more advanced queries, it performs better on complicated queries, but is harder to manage. MySQL is fast, easy to manage, but you can run into it's limitations on advanced queries, stored procedures and the like.
In general, PostgreSQL is best suited for systems that require execution of complex queries, or data warehousing and data analysis. MySQL is the first choice for those web-based projects which require a database merely for data transactions and not anything intricate.
Just went through this myself, well I still am...
INSERT IGNORE
and REPLACE
LOAD DATA INFILE
(COPY
is close, but not close enough)autoincrement
to SERIAL
INNER JOIN
without an ON
clause can't happen, use CROSS JOIN
or the likeCOUNT(*)
can be crazy slowinterval
vs. Postgres interval
(for time intervals)AS
CALL proc();
; rewrite proc()
as a function and SELECT proc();
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With