MySQL and PostgreSQL Command Comparison

Photo by Glenn Carstens-Peters on Unsplash

Command Comparison

Since TSV import is troublesome for both MySQL and PostgreSQL, it is best to create your own script to convert TSV to SQL.

PostgreSQL/MySQL information_schema

Since information_schema is a SQL standard, the same SQL can be used in either case.

Table list

Column list

Setup Default Connection

In PostgreSQL this is set by environment variable

export PGDATABASE = DB name
export PGHOST = host
export PGPORT = port number
export PGUSER = username
export PGPASSWORD = password

The password can also be set with ~/.pgpass

In MySQL we can set all in ~/.my.cnf

[client]
database = DB name
user = username
password = password

 by the author.

--

--

--

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why Lambda Container images & How to do quickly?

Engineering Mindset: Can we get there?

Chapter 6 A Modular Approach to Program Organization

Clean Network Layer in Flutter [Dio + Freezed + Json_Annotation]

Bugs Everywhere!

How to regularly clone a folder in Ubuntu.

The DF10K & PFP Metawrapping

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Maciej

Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

More from Medium

Demystifying Docker (But For Real This Time)

Getting Started with Docker Containers pt.2

How to Change PostgreSQL Data Directory to a separate Hard Drive on Ubuntu 18.04

Understanding Dockerfile