Re: Inherancing - Mailing list pgsql-sql

From Daniel Schuchardt
Subject Re: Inherancing
Date
Msg-id avf20d$m5v$1@news.hub.org
Whole thread Raw
In response to Inherancing  (Nasair Junior da Silva <njunior@univates.br>)
List pgsql-sql
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" <njunior@univates.br> 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




pgsql-sql by date:

Previous
From: Richard Rowell
Date:
Subject: to_date confusion
Next
From: Josh Berkus
Date:
Subject: Re: to_date confusion