For tables that already exist and have a foreign key relationship, is
there an equivalent alter statement for the statement below?
Does this mean that if table xxx.id primary key value changes, the
foreign key value will change as well?
If this is the case, then would not have to match up all the foreign
keys to the new re-sequenced id.
Also another question: if the "id serial primary key", do I need to
create a sequence at all? Or is that managed by the database?
Typically you have to link the id to the database sequence object, but
it looks as in this case no "CREATE SEQUENCE" would be needed.
thanks
J.V.
On 9/30/2011 2:45 AM, John R Pierce wrote:
> create table yyy (id serial primary key, xxx_id int references xxx(id));