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:
ALTER TABLE ONLY tablename
ALTER TABLE tablename
ONLY
nameThe 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.
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?
PostgreSQL , . (SQL: 1999 , .): , . , . . , : , . , , , , ? . capitals , :
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 , . .
capitals , . , , .
PostgreSQL , . .
: https://www.postgresql.org/docs/8.4/static/ddl-inherit.html
- , inherit . , B A, C B, :
B
A
C
( ONLY) - -. , , SELECT UNION SELECT ... FROM ONLY . (, SELECT , , UNION.)
SELECT
UNION
SELECT ... FROM ONLY
, ONLY , .
Source: https://habr.com/ru/post/1690096/More articles:PHP JSON GET displays correctly on a webpage but not in php - jsonResults cv.glmnet vs glmnet; measuring force of explanation - rES6 nested grouping with sum - javascriptMultiline integer literals in Rust - rustСтолбец MySQL JSON теряет десятичную точность, когда объект JSON вставлен как строковый литерал - javaWhat is the synthetic angular property? - angularCannot register a COM object for use in a scheduled task - c #How to properly test a model using ActiveStorage in rails? - ruby-on-railsDoes R ignore variable name extensions starting at a point in the data frame? - rAny elegant way to define an alphanumeric subtype? - stringAll Articles