title: What does :: do in PostgreSQL?
body: <p>I have seen <code>::</code> in variety of places involving postgres code I have seen on the net. For example:</p>
  
  <pre><code>SELECT '{apple,cherry apple, avocado}'::text[];
  </code></pre>
  
  <p>It seems to be some sort of cast. What exactly is <code>::</code> in postgres and when should it be used?</p>
  
  <p>I tried a bit of googling and searched the Postgres docs for <code>::</code> but got no good results.<br>
  I tried following searches in Google: </p>
  
  <ul>
  <li>postgres double colon </li>
  <li>postgres :: </li>
  <li>:: </li>
  </ul>
  
  <p>I tried the following searches in the postgres docs search button </p>
  
  <ul>
  <li>double colon </li>
  <li>double colon cast </li>
  <li>:: </li>
  </ul>
  
  <p>This was almost embarrassing to ask on SO, but I figured Google will hopefully see this answer for other people in the future.</p>