Re: Visibility of data from table inherits function

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Visibility of data from table inherits function
Date: 2022-01-02 21:37:04
Message-ID: 6962fa25-68dd-5115-b177-47ea49614763@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Στις 2/1/22 2:23 μ.μ., ο/η ourdiaspora έγραψε:

> Recipients,
>
> A table was created:
>
> CREATE TABLE exampletable (
> name varchar(200)
> );
>
> Table 'exampletable' _already_ contains data, e.g. 'Jane Bloggs'
>
> A new table was created with inheritance of 'exampletable':
>
>
> Please could someone explain why the data in the table 'exampletable' is not visible from the query using the child table?
>
> Does not 'INHERIT' function apply to the data of the precedent parent table?
Think of it as a list of Numbers in java. Assume you are looking for
Double's, then you transverse the list looking for only Doubles, then
for Integers and you get only Integers, then for Numbers and you get the
whole list. This is the same concept in pgsql inheritance.  A row of
"type"  exampletablechild is a row of "type" exampletable, but not vice
versa: A row of exampletable is NOT a row of exampletablechild.
Selecting directly from exampletablechild it should return to you only
exampletablechild and below.
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2022-01-03 08:04:22 Re: Visibility of data from table inherits function
Previous Message Adrian Klaver 2022-01-02 19:55:36 Re: Visibility of data from table inherits function