triggers and indexes.

From: Tom Larard <larard(at)cs(dot)umb(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: triggers and indexes.
Date: 2001-03-01 20:09:46
Message-ID: Pine.GSO.4.21.0103011448400.12433-100000@u5.cs.umb.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a database in a suitable format to use COPY TO to import. As it
contains 4million records I have dropped both the primary key (because it
creates an index), and the referential integrity triggers. I do this by
just creating the tables without primary keys or triggers. The problem is
that although I can happily now import the data in a very quick time, (<2
hrs) I now need to read the primary key and the referential integrity
triggers.

This is the table I use as I need to import data...
create table discid (
discID varchar(8),
CDID integer not null
)

This is what I really need as a table....
create table discid (
discID varchar(8),
CDID integer not null REFERENCES cds (cdid),
PRIMARY KEY (discID)
)

Does anyone know how to create a trigger that is the same as that created
by postgres to enforce referential integrity? and put an index on CDID
later is not the same as having an indexed primary key, hoe can I do that?

Many thanks in advance.

Tom Larard

Browse pgsql-novice by date

  From Date Subject
Next Message GH 2001-03-01 22:09:25 Re: Backing up with Postgres
Previous Message Luke Tudor - RSG 2001-03-01 17:15:15 Backing up with Postgres