 <p>Take a look at this other answer. It uses the same approach that you do.</p> <p><a href="http://stackoverflow.com/questions/22663599/creating-constant-string-for-a-postgres-entire-database">Creating constant string for a Postgres entire database</a></p>