title: Convert BIGSERIAL to BIGINT
body: <p>I have a table defined across two scripts as follows (I'm eliding unneeded details):</p>
  
  <pre><code>CREATE TABLE a (id BIGSERIAL NOT NULL PRIMARY KEY);
  ALTER TABLE IMAGE ADD COLUMN b_id BIGSERIAL;
  </code></pre>
  
  <p>This results in a table with a column <code>b_id</code> that is a <code>BIGSERIAL</code>, and is a foreign key to table <code>b</code> from <code>a</code>. This is incorrect, however, and I need to alter the table (safely) to drop the <code>SERIAL</code> part and leave it as a <code>BIGINT</code>. (Essentially, that column should not insert an autoincremented number if there is an insert that doesn't specify the value.)</p>
  
  <p>The <a href="http://www.postgresql.org/docs/9.4/static/datatype-numeric.html#DATATYPE-SERIAL" rel="nofollow">documentation</a> indicates that a <code>SERIAL</code> just adds a sequence to the underlying datatype, and there are plenty of results for how to do this manually if you want to move from an integer-based type to a serial-based type, but not the reverse. The documentation says:</p>
  
  <blockquote>
    <p>You can drop the sequence without dropping the column, but this will
    force removal of the column default expression.</p>
  </blockquote>
  
  <p>But the documentation to <a href="http://www.postgresql.org/docs/8.3/static/sql-dropsequence.html" rel="nofollow"><code>DROP SEQUENCE</code></a> is remarkably light in terms of what name to use and what the effects of this are.</p>
  
  <ul>
  <li>Can I <code>DROP SEQUENCE b_id</code> safely to get the result I want (that <code>b_id</code> is a simple <code>BIGINT</code> column?)</li>
  <li>Do I have to do anything else to get the table into a safe state, without disrupting the values?</li>
  </ul>