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

Cometh mission v0.6 🚀

SynRace 2.0

How Can We Put Stakeholders More To the Forefront in Scrum?

Rails Portfolio Project

#100DaysOfCode Day 7: Manipulating Excel Task with Python

Lab 5: Piezo Speakers

How to deploy ROOK with CEPH in Kubernetes

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

Run Docker Inside Docker

How to Write a Good Dockerfile ?

Database Installation in Linux

Tutorials on Docker— Day 7