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 12BB756502 for ; Wed, 9 Mar 2005 13:46:41 +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 15416-10 for ; Wed, 9 Mar 2005 13:46:19 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema.dnscenter.com.br [67.15.80.70]) by svr1.postgresql.org (Postfix) with ESMTP id D1FA2563F6 for ; Wed, 9 Mar 2005 13:46:18 +0000 (GMT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.44) id 1D91Vw-0006Ru-W7 for pgsql-sql@postgresql.org; Wed, 09 Mar 2005 10:46:17 -0300 Received: from 200.158.187.9 ([200.158.187.9]) by www.presserv.org (Horde) with HTTP for ; Wed, 9 Mar 2005 10:46:16 -0300 Message-ID: <20050309104616.8cjneru7plccgss4@www.presserv.org> Date: Wed, 9 Mar 2005 10:46:16 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Table like a field 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=0.948 tagged_above=0 required=5 tests=AWL, NO_REAL_NAME, RCVD_IN_NJABL_PROXY X-Spam-Level: X-Archive-Number: 200503/148 X-Sequence-Number: 20627 Hello. Is there any way to build a table that contain the coluns name for the other table fields? like this: create table people(id serial primary key, name varchar(50) ); create table people_fields ( field_name varchar(30) ); insert into people_fields values ('occupation'); insert into people_fields values ('address'); then I create any function or view to get: SELECT * FROM people; //may return id - name - | ocuppation - address | Then if I insert a new record in the people_fields table, the new record will appear as a new field in the people table. Of course, its not a new field, but when i select by my function/view i can see anything like it. How can I create this function to aggregate the both tables?? Thank you.