Thread

  1. Drop a primary

    Martin Mueller <martinmueller@northwestern.edu> — 2019-10-02T18:48:17Z

    I created a primary key with the following commands
    
    Add id serial
    Add primary key (id)
    
    I cannot figure out from the documentation how to drop that column.
    
    
    
  2. Re: Drop a primary

    Ron <ronljohnsonjr@gmail.com> — 2019-10-02T18:52:54Z

    On 10/2/19 1:48 PM, Martin Mueller wrote:
    >
    > I created a primary key with the following commands
    >
    > Add id serial
    >
    > Add primary key (id)
    >
    > I cannot figure out from the documentation how to drop that column.
    >
    
    Drop it just like you added it:
    
    test=# alter table foobar add id serial;
    ALTER TABLE
    test=# alter table foobar add primary key(id);
    ALTER TABLE
    test=# alter table foobar drop id;
    ALTER TABLE
    
    
    -- 
    Angular momentum makes the world go 'round.