title: Why is PostgreSQL saying a constraint doesn't exist when I try to drop it?
body: <p>I'm working with PostgreSQL 9.1.</p>
  
  <p>In psql I'm using this query to discover what constraints I have in a certain DB...</p>
  
  <pre><code>SELECT
    *
  FROM
    information_schema.constraint_table_usage
  WHERE
    constraint_table_usage.table_catalog = 'journal_app_development'
  AND
    constraint_table_usage.constraint_name NOT LIKE '%_pkey';
  </code></pre>
  
  <p>Output...</p>
  
  <pre><code>        table_catalog      | table_schema | table_name |   constraint_catalog    | constraint_schema | constraint_name 
    -------------------------+--------------+------------+-------------------------+-------------------+-----------------
     journal_app_development | public       | users      | journal_app_development | public            | fk_entry_user
     journal_app_development | public       | users      | journal_app_development | public            | fk_user_task
    (2 rows)
  </code></pre>
  
  <p>But when I try to drop a constraint I get an error...</p>
  
  <pre><code># ALTER TABLE users DROP CONSTRAINT "fk_entry_user";
  ERROR:  constraint "fk_entry_user" of relation "users" does not exist
  </code></pre>
  
  <p>Any idea what I'm doing wrong?</p>
  
  <hr>
  
  <h2>Background info / motivation</h2>
  
  <p>The reason I'm doing this is that I want to write a script (specifically a Rake task) that will drop constraints in the DB that aren't primary keys.</p>