import and foreign keys

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: import and foreign keys
Date: 2001-01-24 05:01:05
Message-ID: Pine.NEB.4.21.0101232252510.9522-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joseph N. Hall 2001-01-24 05:19:12 Re: MySQL has transactions
Previous Message <No Name> 2001-01-24 04:56:01 Re: FW: Postgres-Book from addison-wesley?