Re: Foreign Key Constraints

From: "joemono" <montero7(at)msu(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign Key Constraints
Date: 2002-06-28 16:26:56
Message-ID: afi1tv$2nfn$1@msunews.cl.msu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Actually, I think I figured it out. I had altered the foreign key within
config to it's current condition, but config_values still existed. I guess
there was some data stored somewhere that kept assuming (for config_values)
that config tag was using just ONE column as its foreign key? Or maybe I
have no idea what I'm talking about. That's probably it. :)

When I deleted, and then recreated config_values, and then also config, it
worked.

Anyone have any explanations?

joemono

"joemono" <montero7(at)msu(dot)edu> wrote in message
news:afhubr$2k5b$1(at)msunews(dot)cl(dot)msu(dot)edu(dot)(dot)(dot)
> Hi,
> I'm trying to understand foreign key constraints more, but having a heck
of
> a time doing so. I've been looking through Google groups to try to find
> answers to the problems I'm having, but I haven't come across any as of
yet.
>
> Here is the situation:
>
> I have a table of configurations. The config table has config_tag,
> config_value columns. I also have a table of config_values, ones that are
> valid for the config table. The config_values table has all the possible
> configurations (only about 40 or so) that can be put into the config
table.
>
> Currently, the config_values table has as its primary key (tag, value),
and
> the config table has as a foreign key (config_tag, config_value) which
> references config_values (tag, value). I've also messed around with match
> full, but I'm not sure I understand it completely, and it hasn't solved
the
> problem I'm having yet.
>
> I'm adding some new options, and so I added rows to the config_values
table,
> with completely new tags, but with values that other tags also use. (I'm
> expanding existing options to cover other areas of the project). Now that
> the rows are in the config_values table, I've decided to change them
around,
> and use different values, so I want to delete them. However, I keep
getting:
>
> "fk_config referential integrity violation - key in config_values still
> referenced from config"
>
> Like I said, I've been trying the match full option, because it only makes
> sense to match the config_tag-config_value combination, since many of the
> values have the same...value. Right?
>
> Anyway, I hope this makes sense. Any help is greatly appreciated!
>
> joemono
>
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2002-06-28 16:29:19 Re: Shared Memory Sizing
Previous Message Stephan Szabo 2002-06-28 16:13:33 Re: FTI: help /w compiling/installation wanted (Full Text