What are streaming tables in Postgresql?

Database dumps from Postgresql are used ALTER TABLE ONLY tablenameinstead ALTER TABLE tablename, which I am familiar with. I was curious what the keyword was doing ONLY, so I looked through it in the Postgresql documentation and it says the following:

name

The name (optionally, using the schema) of the existing table to modify. If ONLY is indicated before the table name, only that table is changed. If NOT specified ONLY, the table and all its stream tables (if any) are changed. Optionally, * can be specified after the table name to explicitly indicate that streaming tables are included.

What are streaming tables?

+4
source share
2 answers

PostgreSQL , . (SQL: 1999 , .)

: , . , . . , : , . , , , , ? . capitals , :

CREATE TABLE cities (
    name            text,
    population      float,
    altitude        int     -- in feet
);

CREATE TABLE capitals (
    state           char(2)
) INHERITS (cities);

capitals , . , , .

PostgreSQL , . .

: https://www.postgresql.org/docs/8.4/static/ddl-inherit.html

+3

- , inherit . , B A, C B, :

  • B C - A.
  • C B.

( ONLY) - -. , , SELECT UNION SELECT ... FROM ONLY . (, SELECT , , UNION.)

, ONLY , .

+1

Source: https://habr.com/ru/post/1690096/


All Articles