Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 08C37477357 for ; Tue, 7 Jan 2003 12:16:06 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 491E34772A7 for ; Tue, 7 Jan 2003 12:15:58 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 2C94243A941; Tue, 7 Jan 2003 12:15:58 -0500 (EST) From: "Daniel Schuchardt" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Inherancing Date: Tue, 7 Jan 2003 18:16:48 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 50 Message-ID: References: <20030107094225.0345a050.njunior@univates.br> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/177 X-Sequence-Number: 11042 You have to insert in th centers-table. Because it is inherited from cities, the record is automatically in cities. Search for SELECT * FROM ONLY in the docs too. > create table cities (id int, name varchar, primary key(id) ); > create table centers (state varchar(2)) inherits (cities); > > ant the tuple > insert into cities values (1, 'Lajeado'); Lajeado isn't a center here. You should do : insert into centers .... You can do then SELECT * FROM cities -> you will get all cities. Or SELECT * FROM centers -> you will get all centers. Or SELECT * FROM ONLY cities -> you will get only cities who aren't centers. Daniel. "Nasair Junior da Silva" schrieb im Newsbeitrag news:20030107094225.0345a050.njunior@univates.br... > Hi people, > supposing i have the tables : > > create table cities (id int, name varchar, primary key(id) ); > create table centers (state varchar(2)) inherits (cities); > > ant the tuple > insert into cities values (1, 'Lajeado'); > > How i do if i want to make this city as a center ? > > Thanks, > > xx===============================xx > || °v° Nasair Junior da Silva || > || /(_)\ Linux User: 246054 || > || ^ ^ njunior@univates.br || > ||CPD - Desenvolvimento || > ||Univates - Centro Universitário|| > xx===============================xx > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org