X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2431BDAEF2 for ; Thu, 27 Oct 2005 17:25:01 -0300 (ADT) 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 19396-09 for ; Thu, 27 Oct 2005 20:24:55 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema3.dnscenter.com.br [67.15.81.2]) by svr1.postgresql.org (Postfix) with ESMTP id 146B4D783D for ; Thu, 27 Oct 2005 17:24:56 -0300 (ADT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.52) id 1EVEIu-0007D9-DW for pgsql-sql@postgresql.org; Thu, 27 Oct 2005 17:24:52 -0300 Received: from 201.0.112.67 ([201.0.112.67]) by www.presserv.org (Horde MIME library) with HTTP; Thu, 27 Oct 2005 17:24:52 -0300 Message-ID: <20051027172452.zdz9bjn9bd440ogk@www.presserv.org> Date: Thu, 27 Oct 2005 17:24:52 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Referencing 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.3) 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, score=0.557 required=5 tests=[AWL=-0.320, NO_REAL_NAME=0.55, RCVD_IN_NJABL_PROXY=0.327] X-Spam-Score: 0.557 X-Spam-Level: X-Archive-Number: 200510/377 X-Sequence-Number: 23230 Hi. Is there a way to references dynamic tables? I.E: I have a table called "buy" that create some records in "financial" table, but there is other table called "send" that create other records in "financial". "Financial" table have the moneys' movements and needs to be referenciable by "buy or send". IE: create table buy ( id serial primary key, product_id integer,--references.... value money ); create table send ( id serial primary key, product_id integer, --references... value money ); create table financial( id serial primary key, cred_deb smallint, value money, references integer, --<<-HERE IS THE PROBLEM, it will reference to buy OR send table ); Well, I dont know if I was clean. Thank you.