Transpose two-dimensional array from n rows to 2 columns

The question: Background Using PostgreSQL 9.1, so WITH ORDINAL (a 9.4 feature) is not available. Problem Looking to simplify the code that pivots a two-dimensional array. Code A working, overly-verbose example that illustrates the problem is: SELECT u.aspect, u.preference FROM ( SELECT t.aspect_preference AS aspect, — Skip every second row seq % 2 AS seq, … Read more