Table of Contents

MySQL / Postgres Comparison

Table List

MySQL:

SHOW TABLES

Postgres:

SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name

Column List

MySQL:

SHOW COLUMNS FROM tbl_name

Postgres:

SELECT column_name, udt_name, is_nullable, character_maximum_length
FROM information_schema.columns
WHERE table_name = 'tbl_name'

Concatenation

MySQL:

SELECT CONCAT(fname, ' ', lname) AS name FROM tbl_name

Postgres:

SELECT fname || ' ' || lname AS name FROM tbl_name