Received: from parmastocks2.cylink.com.cy (parmastocks2.cylink.com.cy [194.42.142.6]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6DFCTa21047 for ; Fri, 13 Jul 2001 11:12:30 -0400 (EDT) (envelope-from grigoriy.vovk@linustech.com.cy) Received: from callisto.internal.linustech.com.cy (parmastocks.cylink.com.cy [194.42.135.92]) by parmastocks2.cylink.com.cy (Postfix) with ESMTP id 80E08340B1; Fri, 13 Jul 2001 18:12:05 +0300 (EEST) Date: Fri, 13 Jul 2001 18:12:13 +0300 (EEST) From: "Grigoriy G. Vovk" X-X-Sender: To: James Orr Cc: Subject: Re: Referencing a view? In-Reply-To: <002301c10ba1$90872260$1600000a@lrg.office> Message-ID: <20010713175036.P886-100000@callisto.internal.linustech.com.cy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200107/169 X-Sequence-Number: 3961 Jul 13, 09:41 -0400, James Orr wrote: > Thanks for all the responses! The one from Grigoriy was particularly > interesting, I hadn't thought of that approach. > > However, I came to the realization that if somebody changes their address, I > don't want it to be changed on previous orders. So I think i'll change the > orders table to contain the actual address information and use an INSERT ... > SELECT instead. That way I can be sure I have an accurate record of all > orders. Yes, its really a problem... When information sometime changes but we want to keep old information for depending data. (If I understand correctly what about you are speaking). But, you can resolve the problem if will copy information about address for executed order in a different place as a text, not as a link to the table 'address'. So, after execution of an order you will take current address by the link and copy all information (may be, as one field everything - concat all fields from the address together). Its a one solution. Next - you can use many addresses for an entity, and work only with some of them, 'valid', or 'current', as do you like, not with all. So, you will have full addresses history - when was changed, etc. And the order will always links to correct address, even now current address is different. You can do it by add field 'current' bool in the table 'address' or create additional table 'current_address' which will have 'id_entity' and 'id_address', so if you will do a search on 'current_address' you got a list of current addresses, in case you will do a search on 'address' - you got a list of all addresses. I prefere to create additional table. May be I've explained not well - ask, I'll type an database structure example, for developers it may be easy way :) my best regards, ---------------- Grigoriy G. Vovk