Re: stored procs - Mailing list pgsql-general

From J.V.
Subject Re: stored procs
Date
Msg-id 4E8589E3.5010303@gmail.com
Whole thread Raw
In response to Re: stored procs  (John R Pierce <pierce@hogranch.com>)
Responses Re: stored procs
List pgsql-general
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));

pgsql-general by date:

Previous
From: Gregg Jaskiewicz
Date:
Subject: Re: Rules going away
Next
From: Alban Hertroys
Date:
Subject: Re: stored procs