Στις 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.
>
>
>