PostgreSQL Tutorial

  • Home
  • Stored Procedures
  • Triggers
  • Views
  • Interfaces
    • PostgreSQL PHP
    • PostgreSQL Python
    • PostgreSQL JDBC
  • Functions
Home / PostgreSQL Tutorial / PostgreSQL vs. MySQL

PostgreSQL vs. MySQL

PostgreSQL vs. MySQL is an important decision when it comes to choose an open-source relational database management system. Both PostgreSQL and MySQL are time-proven solutions that can compete with the enterprise solutions such as Oracle, SQL Server, etc.

MySQL has been famous for its ease of use and speed, while PostgreSQL has more advanced features which is often described as an open-source version of Oracle.

The following table compares the features of PostgreSQL vs. MySQL:

PostgreSQL vs. MySQL

 

PostgreSQLMySQL
Known asThe world’s most advanced open source databaseThe world’s most popular open source database
DevelopmentPostgreSQL is an open source projectMySQL is an open-source product
Pronunciationmy ess queue ellpost gress queue ell
LicensingMIT-style licenseGNU General Public License
Implementation programming languageCC/C++
GUI toolPgAdminMySQL Workbench
ACIDYesYes
Storage engineSingle storage engineMultiple storage engines e.g., InnoDB, MyISAM, etc.
Full-text searchYesYes
Drop a temporary tableNo TEMP or TEMPORARY keyword in DROP TABLE statementMySQL supports the TEMP or TEMPORARY keyword in the DROP TABLE statement that allows you to remove the temporary table only.
 DROP TABLE Support CASCADE option to drop table’s dependent objects e.g., tables, views, etc.,Does not support CASCADE option
 TRUNCATE TABLE PostgreSQL TRUNCATE TABLE supports more features like CASCADE, RESTART IDENTITY, CONTINUE IDENTITY, transaction-safe, etc.MySQL TRUNCATE TABLE does not support CASCADE and transaction safe i.e,. once data is deleted, it cannot be rolled back.
Auto increment Column SERIAL AUTO_INCREMENT
Analytic functionsYesNo
Data typesSupport many advanced types such as array, hstore, user-defined type, etc.SQL-standard types
Unsigned integerNoYes
Boolean typeYesUse TINYINT(1) internally for Boolean
IP address data typeYesNo
Set default value for a columnSupport both constant and function callMust be a constant or CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns
CTEYesNo
 EXPLAIN outputMore detailedLess detailed
Materialized viewsYesNo
CHECK constraintYesNo (MySQL ignores the CHECK constraint)
Table inheritanceYesNo
Programming languages for stored proceduresRuby, Perl, Python, TCL, PL/pgSQL, SQL, JavaScript, etc.SQL:2003 syntax for stored procedures
 FULL OUTER JOINYesNo
 INTERSECTYesNo
 EXCEPTYesNo
Partial indexesYesNo
Bitmap indexesYesNo
Expression indexesYesNo
Covering indexesYes (since version 9.2)Yes. MySQL supports covering indexes that allow data to be retrieved by scanning the index alone without touching the table data. This is advantageous with large tables with millions of rows.
Common table expression (CTE)YesNo
TriggersSupport triggers that can fire on most types of command, except for ones affecting the database globally e.g., roles and tablespaces.Limited to some commands
PartitioningRANGE, LISTRANGE, LIST, HASH, KEY, and composite partitioning using a combination of RANGE or LIST with HASH or KEY subpartitions
Task SchedulepgAgentScheduled event
Connection ScalabilityEach new connection is an OS processEach new connection is an OS thread
Previous Tutorial: PostgreSQL Window Function

PostgreSQL Quick Start

  • What is PostgreSQL?
  • Install PostgreSQL
  • Connect to Database
  • Download PostgreSQL Sample Database
  • Load Sample Database
  • Explore Server and Database Objects

PostgreSQL Fundamentals

  • PostgreSQL Select
  • PostgreSQL Order By
  • PostgreSQL Select Distinct
  • PostgreSQL Where
  • PostgreSQL LIMIT
  • PostgreSQL IN
  • PostgreSQL Between
  • PostgreSQL Like
  • PostgreSQL Inner Join
  • PostgreSQL Left Join
  • PostgreSQL Full Outer Join
  • PostgreSQL Cross Join
  • PostgreSQL Natural Join
  • PostgreSQL Group By
  • PostgreSQL Having
  • PostgreSQL Union
  • PostgreSQL Intersect
  • PostgreSQL Except
  • PostgreSQL Subquery
  • PostgreSQL Insert
  • PostgreSQL Update
  • PostgreSQL Delete
  • PostgreSQL Data Types
  • PostgreSQL Create Table
  • PostgreSQL Alter Table
  • PostgreSQL Drop Table
  • PostgreSQL Truncate Table
  • PostgreSQL CHECK Constraint
  • PostgreSQL Not-Null Constraint
  • PostgreSQL Foreign Key
  • PostgreSQL Primary Key
  • PostgreSQL UNIQUE Constraint

About PostgreSQL Tutorial

PostgreSQLTutorial.com is a website dedicated to developers and database administrators who are working on PostgreSQL database management system.

We constantly publish useful PostgreSQL tutorials to keep you up-to-date with the latest PostgreSQL features and technologies. All PostgreSQL tutorials are simple, easy-to-follow and practical.

Recent PostgreSQL Tutorials

  • PostgreSQL UPDATE Join with A Practical Example
  • PostgreSQL Cheat Sheet
  • PostgreSQL vs. MySQL
  • A Step-by-Step Guide To PostgreSQL Temporary Table
  • PostgreSQL RENAME COLUMN: Renaming One or More Columns of a Table
  • PostgreSQL Rename Table: A Step-by-Step Guide
  • PostgreSQL Change Column Type: Step-by-Step Examples
  • PostgreSQL DROP COLUMN: Remove One or More Columns of a Table
  • A Quick Guide To The PostgreSQL TIME Data Type
  • A Comprehensive Look at PostgreSQL Interval Data Type

More Tutorials

  • PostgreSQL Cheat Sheet
  • PostgreSQL Administration
  • PostgreSQL PHP
  • PostgreSQL Python
  • PostgreSQL JDBC
  • PostgreSQL Resources

Site Info

  • Home
  • About Us
  • Contact Us
  • Privacy Policy

Copyright © 2017 by PostgreSQL Tutorial Website. All Rights Reserved.