CREATE TABLE subscriptions ( user_id int NOT NULL, subscription_type text NOT NULL, started date NOT NULL, expires date NOT NULL, PRIMARY KEY (user_id, subscription_type) ); > SELECT country, city, department, count(*) FROM HR GROUP BY ROLLUP (country, city, department) ORDER BY 1, 2, 3; > SELECT country, city, department, count(*) FROM HR GROUP BY CUBE (country, city, department) ORDER BY 1, 2, 3; > SELECT country, city, department, count(*) FROM HR GROUP BY GROUPING SETS ((country, city, department), (country, city), (country), (), (department), (country, department)) ORDER BY 1, 2, 3; > CREATE TABLE logins (tx timestamp, ip_adress, ...); > CREATE TABLE logins_201509 (CHECK (tx >= '2015-09-01' AND tx < '2015-10-01')) INHERITS (logins); > CREATE TABLE logins_201510 (CHECK (tx >= '2015-10-01' AND tx < '2015-11-01')) INHERITS (logins); SELECT avg(preis) FROM article TABLESAMPLE SYSTEM(1); pg_rewind -D /usr/local/pgsql/data --source-server='host=db2 dbname =postgres' test=> select citx, country from HR; \ ERROR: column "citx" does not exist \ LINE 1: select citx, country from HR; \ HINT: Perhaps you meant to reference the column "HR"."city".