title: drop primary key constraint in postgresql by knowing schema and table name only
body: <p>As far I know the only way of dropping primary key in postgresql is:</p>
  <pre class="lang-sql prettyprint-override"><code>ALTER TABLE schema.tableName DROP CONSTRAINT constraint_name;
  </code></pre>
  <p>the constraint name by default is <code>tableName_pkey</code>. However sometimes if table is already renamed I can’t get the original table name to construct right constraint name.</p>
  <p>For example, for a table created as <code>A</code> then renamed to <code>B</code> the constraint remains <code>A_pkey</code> but I only have the table name <code>B</code>.</p>
  <p>Do you know right way to drop the pkey constraint by knowing only the schema name and table name ?</p>
  <p>I am writing program for doing this so I need to use only SQL queries. Solutions like &quot;open pgAdmin and see the constraint name&quot; will not work.</p>