title: How to get the dimensionality of an ARRAY column?
body: <p>I'm working on a project that collects information about your schema from the database directly. I can get the <code>data_type</code> of the column using <code>information_schema.columns</code>, which will tell me if it's an <code>ARRAY</code> or not. I can also get the underlying type (<code>integer</code>, <code>bytea</code> etc) of the <code>ARRAY</code> by querying <code>information_schema.element_types</code> as described here: </p>
  
  <p><a href="https://www.postgresql.org/docs/9.1/static/infoschema-element-types.html" rel="nofollow">https://www.postgresql.org/docs/9.1/static/infoschema-element-types.html</a></p>
  
  <p>My problem is that I also need to know how many dimensions the array has, whether it is <code>integer[]</code>, or <code>integer[][]</code> for example. Does anyone know of a way to do this? Google isn't being very helpful here, hopefully someone more familiar with the Postgres spec can lead me in the right direction.</p>