import and foreign keys

Поиск
Список
Период
Сортировка
От Thomas T. Thai
Тема import and foreign keys
Дата
Msg-id Pine.NEB.4.21.0101232252510.9522-100000@ns01.minnesota.com
обсуждение исходный текст
Список pgsql-general
i'm in the process of importing my data from my existing db (mysql) to
pgsql. one thing i'm confused about is the use of foreign keys. in my
existing db, i use the foreign keys to relate from one table to the
next. it's a forum type application. the key is based on an auto-increment
field.

in the past when i've dumped my data from mysql and re-import it back into
mysql it figured out that the foreign keys (auto-increment) are just what
they are and do the proper things so that those auto-increment field keep
on incrementing from the last highest number.

i'm wondering what will happen to that field if i import into pgsql? will
pgsql figure out what the last highest id is and continue from
there? assuming i've defined my table structures properly using:

CREATE SEQUENCE "next_url_id" start 1 increment 1 maxvalue 2147483647

CREATE TABLE "url" (
        "rec_id" integer DEFAULT nextval('next_url_id'::text) NOT NULL,
...

the reason i'm hesitant is because i've been reading the mailing list on
this subject and i'm confused. there were some talks about how i'd lose my
relations between tables because the foreign keys would be lost during
import. i think this was on the thread about OID etc.


В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Leibel
Дата:
Сообщение: Re: MySQL has transactions
Следующее
От: Frank Joerdens
Дата:
Сообщение: Re: Looking for info on Solaris 7 (SPARC) specific considerations