Thanks, doing a SELECT to see if the city (etc.) was there is
exactly what I am trying to avoid.
Gurus, any comments?
On Tue, 8 Oct 2002, Devinder K Rajput wrote:
>
> Josh,
>
> I am assuming that data gets entered into the customers table and then
> should automagically update the cities, states, and zip_codes tables. For
> example, if a new record or update contains the city "Chicago" and Chicago
> doesn't exist in cities, it should be added/inserted. There might be a way
> to do this by setting up integrity constraints ( i don't know how), but you
> could also do it in code. When a record is inserted/updated in the
> customers table, do a select with the city value in the cities table to see
> if the city exists. if the city doesn't exist, insert it. Do the same
> with states and zip codes. This is some work and like I said, you might
> able to do it integrity constraints, but we need some help from the
> postgres gurus to see if that's possible.
>
> regards,
>
> Devinder Rajput