Closed unfif closed 3 years ago
postgres=# \d races Table "public.races" Column | Type | Collation | Nullable | Default ----------------+--------------------------+-----------+----------+--------- raceid | text | | not null | year | integer | | | place | text | | | racenum | integer | | | title | text | | | coursetype | text | | | distance | integer | | | courseinfo1 | text | | | courseinfo2 | text | | | weather | text | | | condition | text | | | datetime | timestamp with time zone | | | date | date | | | posttime | time with time zone | | | generation | text | | | racegrade | text[] | | | starters | integer | | | addedmoneylist | integer[] | | | requrl | text | | | Indexes: "races_pkey" PRIMARY KEY, btree (raceid) Foreign-key constraints: "races_place_coursetype_generation_distance_courseinfo1_cou_fkey" FOREIGN KEY (place, coursetype, generation, distance, courseinfo1, courseinfo2) REFERENCES jrarecords(place, coursetype, generation, distance, courseinfo1, courseinfo2) Referenced by: TABLE "horseresults" CONSTRAINT "horseresults_raceid_fkey" FOREIGN KEY (raceid) REFERENCES races(raceid) TABLE "paybacks" CONSTRAINT "paybacks_raceid_fkey" FOREIGN KEY (raceid) REFERENCES races(raceid)
postgres=# \d jrarecords Table "public.jrarecords" Column | Type | Collation | Nullable | Default ----------------+------------------------+-----------+----------+--------- place | text | | not null | coursetype | text | | not null | generation | text | | not null | distance | integer | | not null | courseinfo1 | text | | not null | courseinfo2 | text | | not null | time | time without time zone | | | horsename | text | | | sire | text | | | dam | text | | | sex | text | | | age | integer | | | jockeyweight | double precision | | | jockey | text | | | jockeyfullname | text | | | date | date | | | weather | text | | | condition | text | | | reference | boolean | | | Indexes: "jrarecords_pkey" PRIMARY KEY, btree (place, coursetype, generation, distance, courseinfo1, courseinfo2) Referenced by: TABLE "races" CONSTRAINT "races_place_coursetype_generation_distance_courseinfo1_cou_fkey" FOREIGN KEY (place, coursetype, generation, distance, courseinfo1, courseinfo2) REFERENCES jrarecords(place, coursetype, generation, distance, courseinfo1, courseinfo2)
alter table races drop constraint races_place_coursetype_generation_distance_courseinfo1_cou_fkey;