Since Postgres 10
A LATERAL subquery is the clean, versatile solution, and works since Postgres 9.3, where LATERAL was added:
SELECT t.id, v.value
FROM tbl t
LEFT JOIN LATERAL unnest(t.values) AS v(value) ON true;
Or, with minimal syntax:
SELECT id, value
FROM tbl
LEFT JOIN LATERAL unnest(values) value ON true;
fiddle
See:
Original answer
This works up to Postgres 9.6. The behavior of set-returning functions in the SELECT list was sanitized in Postgres 10, the short syntax below stops working. See:
Flip the logic in the currently accepted answer by @a_horse:
SELECT id, CASE WHEN values <> '{}' THEN unnest(values) END AS value
FROM tbl;
fiddle
This returns a row with NULL in value for an empty array as well as for a NULL array, because only an array with elements in it produces true in the test values <> '{}'.
Works for arrays of any type, since the literal '{}' is automatically coerced to a matching type.
Without explicit ELSE branch, CASE returns NULL, which is what we want anyway.
Arrays with a NULL elements will return rows regardless.
However, I found an anomaly which I addressed in a related question:
Turned out to be a bug. It was fixed after my report for Postgres 9.3+.