title: How to escape string while matching pattern in PostgreSQL
body: <p>I want to find rows where a text column begins with a user given string, e.g. <code>SELECT * FROM users WHERE name LIKE 'rob%'</code> but "rob" is unvalidated user input. If the user writes a string containing a special pattern character like "rob_", it will match both "robert42" and "rob_the_man". I need to be sure that the string is matched literally, how would I do that? Do I need to handle the escaping on an application level or is it a more beautiful way?</p>
  
  <p>I'm using PostgreSQL 9.1 and <a href="https://github.com/lxn/go-pgsql" rel="nofollow">go-pgsql</a> for Go.</p>