Setting table ids in slony

Поиск
Список
Период
Сортировка
Искать
От
Pat Maddox
Тема
Setting table ids in slony
Дата
Msg-id
810a540e0704231049s3f0b7aabsa8fab0cf91bbb814@mail.gmail.com
Список
Дерево обсуждения
Setting table ids in slony "Pat Maddox" <pergesu@gmail.com>
Re: Setting table ids in slony Richard Huxton <dev@archonet.com>
Re: Setting table ids in slony "Pat Maddox" <pergesu@gmail.com>
Re: Setting table ids in slony Chris <dmagick@gmail.com>
Re: Setting table ids in slony Richard Huxton <dev@archonet.com>
I want to start using slony for replication, and have a question about
setting table IDs when creating replication sets.  The docs say that
you have to be careful in what IDs you assign to the tables - if
there's a relationship between two tables, the parent needs to have a
lower ID.

So let's take two tables, users and articles.

Users:
id serial primary key
name varchar(80)

Articles:
id serial primary key
title varchar(80)
body text
user_id (foreign key on users.id)

If I'm using slony to replicate this db, then I need to give the users
table an id of 1, and articles should be 2, right?

What happens when I add a table that's higher up on the heirarchy?
For example now I want to add a companies table.

Companis:
id serial primary key
name varchar(80)

Users:
company_id (fkey on companies.id)

Now would I have to reassign IDs for the tables?  companies->1,
users->2, articles->3?

Thanks for any help.

Pat
В списке pgsql-general по дате отправления
От: Tilmann Singer
Дата:
От: Raymond O'Donnell
Дата:
FAQ