Re: Remove Modifiers on Table - Mailing list pgsql-general

From Carlos Mennens
Subject Re: Remove Modifiers on Table
Date
Msg-id BANLkTikbdn_b3VtA4vQ+m=HFSrs5n0n4_A@mail.gmail.com
Whole thread Raw
In response to Re: Remove Modifiers on Table  (Raymond O'Donnell <rod@iol.ie>)
Responses Re: Remove Modifiers on Table
Re: Remove Modifiers on Table
List pgsql-general
On Tue, May 17, 2011 at 2:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:
> That's because of what I just mentioned above. :-) It's not a type: it's
> just a shortcut. What you need to do instead is something like this:
>
>  -- Create the sequence.
>  create sequence users_id_seq;
>
>  -- Tell the column to pull default values from the sequence.
>  alter table users alter column id set default nextval('users_id_seq');
>
>  -- Establish a dependency between the column and the sequence.
>  alter sequence users_id_seq owned by users.id;

Yup - that explains that the shortcut doesn't work for existing tables
but only during CREATE TABLE. Otherwise I will need to manually CREATE
SEQUENCE...blah blah blah.

Thank you!

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Remove Modifiers on Table
Next
From: Adrian Klaver
Date:
Subject: Re: Remove Modifiers on Table