X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 617848BA406 for ; Wed, 16 Feb 2005 16:43:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80557-01 for ; Wed, 16 Feb 2005 16:43:09 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema.dnscenter.com.br [67.15.80.70]) by svr1.postgresql.org (Postfix) with ESMTP id 21C5A8BA412 for ; Wed, 16 Feb 2005 16:43:07 +0000 (GMT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.44) id 1D1SGT-0005d8-3N for pgsql-sql@postgresql.org; Wed, 16 Feb 2005 13:43:01 -0300 Received: from 200.148.63.155 ([200.148.63.155]) by www.presserv.org (Horde) with HTTP for ; Wed, 16 Feb 2005 13:43:01 -0300 Message-ID: <20050216134301.5myrfpr3ck6bmswc@www.presserv.org> Date: Wed, 16 Feb 2005 13:43:01 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Relation in tables MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iracema.dnscenter.com.br X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 502] / [47 12] X-AntiAbuse: Sender Address Domain - presserv.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.278 tagged_above=0 required=5 tests=NO_DNS_FOR_FROM, NO_REAL_NAME X-Spam-Level: * X-Archive-Number: 200502/165 X-Sequence-Number: 20276 Hello all... I am starting in Postgresql... And I have a question: I am developing a DB system to manage products, but the products may be separated by departaments (with its respectives coluns)... Like: CREATE TABLE products( id serial primary key, desc valchar(100), ... ); Okay, but the products is typed by "amount departament" and this departament should not have access to other coluns like "values, Money, etc...". The "finances departament" may modify the data into products table, but this departament should not have access to coluns like "amounts, etc...". I' ve tried to create the products table with INHERITS but its not right... look: CREATE TABLE prod_amounts ( amount_min numeric, amount_cur numeric, amount_max numeric, ... ) INHERITS products; CREATE TABLE prod_values ( buy_value money, sen_value money, ... ) INHERITS products; Okay, but the problem is: I can INSERT a prod_amounts normaly and automaticaly the products table will be filled, but when i try to modify the data in prod_amounts (references in products) there is no data.... I think its not right ( I am sure :/ ). How Can I do it??? How Can I References Between Prod_amounts and Prod_Values automaticaly? remembering the Amounts departament may not access the Values departament data and the Values departament may not access the amounts data... And the products will be registred (typed) in Amount departament.... Thanks for all.