Re: hiding normalization with views - Mailing list pgsql-novice

From Joshua Daniel Franklin
Subject Re: hiding normalization with views
Date
Msg-id Pine.LNX.4.44.0210081346040.26783-100000@iocc.com
Whole thread Raw
In response to Re: hiding normalization with views  ("Devinder K Rajput" <Devinder.Rajput@ipaper.com>)
Responses Re: hiding normalization with views  (Randy Neumann <Randy_Neumann@centralref.com>)
List pgsql-novice
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


pgsql-novice by date:

Previous
From: "Devinder K Rajput"
Date:
Subject: Re: hiding normalization with views
Next
From: Josh Berkus
Date:
Subject: Re: hiding normalization with views