Blog Archives

Postgres ‘Show’ database, table, …

mysql: SHOW TABLES postgresql: \d postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public’; mysql: SHOW DATABASES postgresql: \l postgresql: SELECT datname FROM pg_database; mysql: SHOW COLUMNS postgresql: \d table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name =’table’; mysql: DESCRIBE TABLE postgresql: \d+ table postgresql: SELECT column_name FROM information_schema.columns WHERE table_name =’table’;

Posted in MySQL, PostgreSQL

Postgres – Show current settings

This is VERY easy show all;    

Posted in PostgreSQL, SQL

Create schema vs create database

CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2.

Posted in Data Warehouse, ETL, MySQL, PostgreSQL