Conditional expressions in Postgres

published on
A simple example from Postgres offical documents: SELECT * FROM test; a --- 1 2 3 SELECT a, CASE WHEN a=1 THEN 'one' WHEN a=2 THEN 'two' ELSE 'other' END FROM test; a | case ---+------- 1 | one 2 | two 3 | other It is based on this form: CASE WHEN condition THEN result [WHEN ...] [ELSE result] END It is very convenient in aggregation functions, just think table foo below: Read More...

Emacs is a habit

published on
What is Emacs EMACS may stand for Editing MACroS, but it has some more creative definitions. Here they are. Emacs Makes A Computer Slow Emacs May Annihilate Command Structures Evenings, Mornings, And a Couple of Saturdays Ever Made A Control-key Setup? Elephantine Memory Absolutely Considered Sine que non Emacs Makers Are Crazy Sickos … My road to mutiny Interactive Mode I used Vim more than three years before Emacs, so I think I’m very familiar with it. Read More...