title: Split string after every nth character
body: <p>Is there a way how to split string after every nth character in PostgreSQL? I thought <code>regexp_split_to_array</code> can be used to do this:</p>
  
  <pre><code>select unnest(regexp_split_to_array('abcdefgh', E'...regexp here...'));
  </code></pre>
  
  <p>Example input: <code>abcdefgh</code></p>
  
  <p>Required output (split after every 2nd character):</p>
  
  <pre><code>ab
  cd
  ef
  gh
  </code></pre>
  
  <p>Required output (split after every 3rd character):</p>
  
  <pre><code>abc
  def
  gh
  </code></pre>
  
  <p>What regexp will do this? Is there any other solution?</p>