DEV Community

Discussion on: PostgreSQL or MySQL: What Should I Choose for My Full-Stack Project?

Collapse
 
tanzimibthesam profile image
Tanzim Ibthesam

Nice how many days can it take for someone to switch from mysql to postgres?

Collapse
 
ttfkam profile image
Miles

Depends on how much MySQL-specific syntax you're using. Here are some examples:

  • Function definitions can be quite different.
  • Query variables are what you'd use in MySQL prior to the introduction of CTEs.
  • Table and column comments can't be inline on Postgres.

Beyond that, you'll need to replace your database client library. For Java it's trivial due to JDBC. If you're using Node for example, because there's no common DB interface, you'd have to make code changes wherever SQL is invoked.

If you're using a popular ORM without punching out to native queries, not long at all. If you have a bunch of native queries or a bespoke ORM that only supports MySQL, you're in for some work.