Re: stored procs

From: "J(dot)V(dot)" <jvsrvcs(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: stored procs
Date: 2011-09-30 09:20:35
Message-ID: 4E8589E3.5010303@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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));

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2011-09-30 10:05:22 Re: stored procs
Previous Message Gregg Jaskiewicz 2011-09-30 09:18:09 Re: Rules going away