From 38791012cb2883337a1ad4c9980e3afcd462119e Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Mon, 25 Mar 2024 17:20:42 +0300 Subject: [PATCH 01/12] Initial commit --- .../statements/create_table/syntax.md | 2 +- .../postgresql/statements/create_table.md | 8 +++---- .../yql-core/syntax/_includes/create_table.md | 13 +++++++++++- ydb/docs/presets.yaml | 1 + .../postgresql/statements/create_table.md | 18 ++++++++-------- .../yql-core/syntax/_includes/create_table.md | 21 ++++++++++++++----- 6 files changed, 43 insertions(+), 20 deletions(-) diff --git a/ydb/docs/en/core/postgresql/_includes/statements/create_table/syntax.md b/ydb/docs/en/core/postgresql/_includes/statements/create_table/syntax.md index 4701fd378484..78bc3cb3bdef 100644 --- a/ydb/docs/en/core/postgresql/_includes/statements/create_table/syntax.md +++ b/ydb/docs/en/core/postgresql/_includes/statements/create_table/syntax.md @@ -1,5 +1,5 @@ ```sql -CREATE [TEMPORARY] TABLE ( +CREATE [TEMPORARY | TEMP] TABLE
( [COLLATE][PRIMARY KEY] diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index 892ba001f80f..a40294ab4bf8 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -11,7 +11,7 @@ The `CREATE TABLE` statement is used to create an empty table in the current dat When creating a table, you can specify: -1. **Table Type**: `TEMPORARY` (not fully supported yet and used only in tests) – a temporary table that is automatically deleted at the end of the session or at the end of the current transaction. If this parameter is not set (left empty), a permanent table is created. +1. **Table Type**: `TEMPORARY` / `TEMP` – a temporary table that is automatically deleted at the regular end of the session, otherwise it will no longer be available and will be automatically deleted after the time has elapsed. If this parameter is not set (left empty), a permanent table is created. 2. **Table Name**: `
` – you can use English letters in lowercase, numbers, and underscores. For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). 3. **Column Name**: `` – the same naming rules apply as for table names. 4. **Data Type**: `` – [standard PostgreSQL data types](https://www.postgresql.org/docs/14/datatype.html) are specified. @@ -26,12 +26,12 @@ When creating a table, you can specify: ## Creating two tables with primary key autoincrement {#create_table_pk_serial} #| || **Table people** | **Table social_card** || -|| +|| {% include [create_table_people](../_includes/statements/create_table/create_table_people.md) %} -| +| {% include [create_table_social_card](../_includes/statements/create_table/create_table_social_card.md) %} @@ -60,7 +60,7 @@ The temporary table functionality is not fully implemented. Temporary tables may {% include [create_table_temp](../_includes/statements/create_table/create_table_temp.md) %} -The temporary table is defined using the `TEMPORARY` keyword. It exists until the end of the session or the completion of the transaction, after which it is automatically deleted. +The temporary table is defined using the `TEMPORARY` or `TEMP` keywords. It exists until the end of the session, after which it is automatically deleted. ## Creating a table with sorting conditions {#create_table_collate} diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index 41b62a6e2bf2..caa579a6e7d5 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -25,7 +25,7 @@ The table is created automatically during the first [INSERT INTO](insert_into.md The `CREATE TABLE` call creates a {% if concept_table %}[table]({{ concept_table }}){% else %}table{% endif %} with the specified data schema{% if feature_map_tables %} and key columns (`PRIMARY KEY`){% endif %}. {% if feature_secondary_index == true %}It lets you define secondary indexes on the created table.{% endif %} - CREATE TABLE table_name ( + CREATE [TEMPORARY | TEMP] TABLE table_name ( column1 type1, {% if feature_not_null == true %} column2 type2 NOT NULL,{% else %} column2 type2,{% endif %} ... @@ -113,6 +113,17 @@ CREATE TABLE my_table ( ``` {% endif %} +{% if feature_temp_tables %} +{% if feature_olap_tables %}#{%endif%}## Creating a temporary table {#row-additional} +```sql +CREATE TEMPORARY TABLE table_name ( + ... +); +``` +`TEMPORARY` / `TEMP` – a temporary table that is automatically deleted at the regular end of the session, otherwise it will no longer be available and will be automatically deleted after the time has elapsed. If this parameter is not set (left empty), a permanent table is created. + +{% endif %} + {% if feature_map_tables and concept_table %} {% if feature_olap_tables %}#{% endif %}## Additional parameters {#row-additional} diff --git a/ydb/docs/presets.yaml b/ydb/docs/presets.yaml index a75a7f52ce09..eee229de4295 100644 --- a/ydb/docs/presets.yaml +++ b/ydb/docs/presets.yaml @@ -43,6 +43,7 @@ default: oss: true feature_not_null_for_pk: true feature_not_null: true + feature_temp_tables: true has_create_table_link: true ydb_non_deterministic_functions: true diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index 4ec987fe2f14..6e68573241d2 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -5,7 +5,7 @@ Инструкция `CREATE TABLE` предназначена для создания пустой таблицы в текущей базе данных. Синтаксис команды: ```sql -CREATE [TEMPORARY] TABLE
( +CREATE [TEMPORARY | TEMP] TABLE
( [COLLATE][PRIMARY KEY] @@ -15,7 +15,7 @@ CREATE [TEMPORARY] TABLE
( ); ``` При создании таблицы можно задать: -1. **Тип таблицы**: `TEMPORARY` (поддерживается не полностью и используется только в тестах) – временная таблица, которая автоматически удаляется в конце сеанса или в конце текущей транзакции. Если параметр не задан (оставлен пустым) – создается постоянная таблица; +1. **Тип таблицы**: `TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при штатном завершении сессии, в противном случае она становится недоступна и удаляется по истечении некоторого времени. Если параметр не задан (оставлен пустым) – создается постоянная таблица; 2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры и нижнее подчёркивание. Например, название таблицы "People" будет сохранено как "people"; 3. **Имя столбца/колонки**: – действую такие же правила нейминга как и для имен таблиц; 4. **Тип данных**: – указываются [стандартные типы](https://www.postgresql.org/docs/current/datatype.html) данных PostgreSQL; @@ -30,7 +30,7 @@ CREATE [TEMPORARY] TABLE
( ## Создание двух таблиц с первичным ключом и автоинкрементом {#create_table_pk_serial} #| || **Таблица people** | **Таблица social_card** || -|| +|| ```sql CREATE TABLE people ( id Serial PRIMARY KEY, @@ -44,8 +44,8 @@ CREATE TABLE people ( sex Text, social_card_number Int ); -``` -| +``` +| ```sql CREATE TABLE social_card ( id Serial PRIMARY KEY, @@ -55,8 +55,8 @@ CREATE TABLE social_card ( issue Date, expiry Date, issuing_authority Text, - category Text -); + category Text +); ``` || |# @@ -83,7 +83,7 @@ CREATE TABLE people ( ); ``` -В этом примере мы создали таблицу "people" с ограничением (блоком `CONSTRAINT`), в котором задали первичный ключ (`PRIMARY KEY`) для колонки "id". Альтернативная запись может выглядеть так: `PRIMARY KEY(id)` без указания ключевого слова `CONSTRAINT`. +В этом примере мы создали таблицу "people" с ограничением (блоком `CONSTRAINT`), в котором задали первичный ключ (`PRIMARY KEY`) для колонки "id". Альтернативная запись может выглядеть так: `PRIMARY KEY(id)` без указания ключевого слова `CONSTRAINT`. ## Создание временной таблицы {#create_table_temp_table} @@ -103,7 +103,7 @@ CREATE TEMPORARY TABLE people ( ); ``` -Временная таблица задается через ключевое слово `TEMPORARY`. Она существует до конца сеанса или до завершения транзакции, далее она автоматически удаляется. +Временная таблица задается через ключевое слово `TEMPORARY`. Она существует до конца сессии, далее таблица автоматически удаляется. ## Создание таблицы с условиями сортировки {#create_table_collate} diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index 4e86b2370056..fde05d9a087e 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -25,7 +25,7 @@ Вызов `CREATE TABLE` создает {% if concept_table %}[таблицу]({{ concept_table }}){% else %}таблицу{% endif %} с указанной схемой данных{% if feature_map_tables %} и ключевыми колонками (`PRIMARY KEY`){% endif %}. {% if feature_secondary_index == true %}Позволяет определить вторичные индексы на создаваемой таблице.{% endif %} - CREATE TABLE table_name ( + CREATE [TEMP | TEMPORARY] TABLE table_name ( column1 type1, {% if feature_not_null == true %} column2 type2 NOT NULL,{% else %} column2 type2,{% endif %} ... @@ -86,7 +86,7 @@ Конструкция INDEX используется для определения {% if concept_secondary_index %}[вторичного индекса]({{ concept_secondary_index }}){% else %}вторичного индекса{% endif %} на таблице: ```sql -CREATE TABLE table_name ( +CREATE TABLE table_name ( ... INDEX GLOBAL [SYNC|ASYNC] ON ( ) COVER ( ), ... @@ -114,6 +114,17 @@ CREATE TABLE my_table ( ``` {% endif %} +{% if feature_temp_tables %} +{% if feature_olap_tables %}#{%endif%}## Создание временных таблиц {#row-additional} +```sql +CREATE TEMPORARY TABLE table_name ( + ... +); +``` +`TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при штатном завершении сессии, в противном случае она становится недоступна и удаляется по истечении некоторого времени. Если параметр не задан (оставлен пустым) – создается постоянная таблица. + +{% endif %} + {% if feature_map_tables and concept_table %} {% if feature_olap_tables %}#{%endif%}## Дополнительные параметры {#row-additional} @@ -210,10 +221,10 @@ CREATE TABLE table_name ( ... ) PARTITION BY HASH(column1, column2, ...) -WITH ( +WITH ( STORE = COLUMN, - key = value, - ... + key = value, + ... ) ``` From 3855f9376bfc806ee490d3cf001181436e8c5ef9 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Mon, 25 Mar 2024 17:25:46 +0300 Subject: [PATCH 02/12] Fixes --- ydb/docs/ru/core/postgresql/statements/create_table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index 6e68573241d2..379753ad19fc 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -103,7 +103,7 @@ CREATE TEMPORARY TABLE people ( ); ``` -Временная таблица задается через ключевое слово `TEMPORARY`. Она существует до конца сессии, далее таблица автоматически удаляется. +Временная таблица задается через ключевое слово `TEMPORARY` / `TEMP`. Она существует до конца сессии, далее таблица автоматически удаляется. ## Создание таблицы с условиями сортировки {#create_table_collate} From 3a50338bbd0855a859f83efa6ca7e1902366040b Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Mon, 25 Mar 2024 17:39:18 +0300 Subject: [PATCH 03/12] Fixes --- ydb/docs/en/core/postgresql/statements/create_table.md | 9 +-------- ydb/docs/ru/core/postgresql/statements/create_table.md | 8 -------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index a40294ab4bf8..74990b950f2a 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -51,14 +51,7 @@ In this example, we created the "people" table with a constraint block (`CONSTRA ## Creating a temporary table {#create_table_temp_table} - -{% note warning %} - -The temporary table functionality is not fully implemented. Temporary tables may not be deleted. Therefore, they can be used for testing, but not for production. - -{% endnote %} - -{% include [create_table_temp](../_includes/statements/create_table/create_table_temp.md) %} +{% include [create_table_temp.md](../../../_includes/postgresql/statements/create_table/create_table_temp.md) %} The temporary table is defined using the `TEMPORARY` or `TEMP` keywords. It exists until the end of the session, after which it is automatically deleted. diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index 379753ad19fc..566894269aba 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -88,14 +88,6 @@ CREATE TABLE people ( ## Создание временной таблицы {#create_table_temp_table} - -{% note warning %} - -Функциональность временной таблицы реализована не полностью. - -{% endnote %} - - ```sql CREATE TEMPORARY TABLE people ( id serial PRIMARY KEY, From 85510fdc57eb144401967d35ada4c1a4832551c8 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Wed, 27 Mar 2024 16:05:26 +0300 Subject: [PATCH 04/12] Fixes --- ydb/docs/en/core/postgresql/statements/create_table.md | 4 ++-- .../yql/reference/yql-core/syntax/_includes/create_table.md | 5 +++-- ydb/docs/ru/core/postgresql/statements/create_table.md | 4 ++-- .../yql/reference/yql-core/syntax/_includes/create_table.md | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index 74990b950f2a..2f078f55acca 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -11,7 +11,7 @@ The `CREATE TABLE` statement is used to create an empty table in the current dat When creating a table, you can specify: -1. **Table Type**: `TEMPORARY` / `TEMP` – a temporary table that is automatically deleted at the regular end of the session, otherwise it will no longer be available and will be automatically deleted after the time has elapsed. If this parameter is not set (left empty), a permanent table is created. +1. **Table Type**: {% include [x](../../_includes/temp_table_description.md) %} 2. **Table Name**: `
` – you can use English letters in lowercase, numbers, and underscores. For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). 3. **Column Name**: `` – the same naming rules apply as for table names. 4. **Data Type**: `` – [standard PostgreSQL data types](https://www.postgresql.org/docs/14/datatype.html) are specified. @@ -53,7 +53,7 @@ In this example, we created the "people" table with a constraint block (`CONSTRA {% include [create_table_temp.md](../../../_includes/postgresql/statements/create_table/create_table_temp.md) %} -The temporary table is defined using the `TEMPORARY` or `TEMP` keywords. It exists until the end of the session, after which it is automatically deleted. +The temporary table is defined using the `TEMPORARY` or `TEMP` keywords. ## Creating a table with sorting conditions {#create_table_collate} diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index caa579a6e7d5..4827029bacc7 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -114,13 +114,14 @@ CREATE TABLE my_table ( {% endif %} {% if feature_temp_tables %} -{% if feature_olap_tables %}#{%endif%}## Creating a temporary table {#row-additional} +{% if feature_olap_tables %}#{%endif%}## Creating a temporary table {#temporary_tables} ```sql CREATE TEMPORARY TABLE table_name ( ... ); ``` -`TEMPORARY` / `TEMP` – a temporary table that is automatically deleted at the regular end of the session, otherwise it will no longer be available and will be automatically deleted after the time has elapsed. If this parameter is not set (left empty), a permanent table is created. + +{% include [x](../../../../../_includes/temp_table_description.md) %} {% endif %} diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index 566894269aba..b12d9e940c65 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -15,7 +15,7 @@ CREATE [TEMPORARY | TEMP] TABLE
( ); ``` При создании таблицы можно задать: -1. **Тип таблицы**: `TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при штатном завершении сессии, в противном случае она становится недоступна и удаляется по истечении некоторого времени. Если параметр не задан (оставлен пустым) – создается постоянная таблица; +1. **Тип таблицы**: {% include [x](../../_includes/temp_table_description.md) %} 2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры и нижнее подчёркивание. Например, название таблицы "People" будет сохранено как "people"; 3. **Имя столбца/колонки**: – действую такие же правила нейминга как и для имен таблиц; 4. **Тип данных**: – указываются [стандартные типы](https://www.postgresql.org/docs/current/datatype.html) данных PostgreSQL; @@ -95,7 +95,7 @@ CREATE TEMPORARY TABLE people ( ); ``` -Временная таблица задается через ключевое слово `TEMPORARY` / `TEMP`. Она существует до конца сессии, далее таблица автоматически удаляется. +Временная таблица задается через ключевые слова `TEMPORARY` или `TEMP`. ## Создание таблицы с условиями сортировки {#create_table_collate} diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index fde05d9a087e..85af38994992 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -115,13 +115,13 @@ CREATE TABLE my_table ( {% endif %} {% if feature_temp_tables %} -{% if feature_olap_tables %}#{%endif%}## Создание временных таблиц {#row-additional} +{% if feature_olap_tables %}#{%endif%}## Создание временных таблиц {#temporary_tables} ```sql CREATE TEMPORARY TABLE table_name ( ... ); ``` -`TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при штатном завершении сессии, в противном случае она становится недоступна и удаляется по истечении некоторого времени. Если параметр не задан (оставлен пустым) – создается постоянная таблица. +{% include [x](../../../../../_includes/temp_table_description.md) %} {% endif %} From 4bd34f39a22d823cfdefb5f1efd9ef328b2131dd Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Wed, 27 Mar 2024 16:21:19 +0300 Subject: [PATCH 05/12] Fixes --- ydb/docs/en/core/postgresql/statements/create_table.md | 2 +- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- ydb/docs/ru/core/postgresql/statements/create_table.md | 2 +- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index 2f078f55acca..9c368d36a296 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -11,7 +11,7 @@ The `CREATE TABLE` statement is used to create an empty table in the current dat When creating a table, you can specify: -1. **Table Type**: {% include [x](../../_includes/temp_table_description.md) %} +1. **Table Type**: {% include [../../_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} 2. **Table Name**: `
` – you can use English letters in lowercase, numbers, and underscores. For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). 3. **Column Name**: `` – the same naming rules apply as for table names. 4. **Data Type**: `` – [standard PostgreSQL data types](https://www.postgresql.org/docs/14/datatype.html) are specified. diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index 4827029bacc7..f2453bef1a7b 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ); ``` -{% include [x](../../../../../_includes/temp_table_description.md) %} +{% include [../../../../../_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} {% endif %} diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index b12d9e940c65..f371e48c7c64 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -15,7 +15,7 @@ CREATE [TEMPORARY | TEMP] TABLE
( ); ``` При создании таблицы можно задать: -1. **Тип таблицы**: {% include [x](../../_includes/temp_table_description.md) %} +1. **Тип таблицы**: {% include [../../_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} 2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры и нижнее подчёркивание. Например, название таблицы "People" будет сохранено как "people"; 3. **Имя столбца/колонки**: – действую такие же правила нейминга как и для имен таблиц; 4. **Тип данных**: – указываются [стандартные типы](https://www.postgresql.org/docs/current/datatype.html) данных PostgreSQL; diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index 85af38994992..2a947bddd17c 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ... ); ``` -{% include [x](../../../../../_includes/temp_table_description.md) %} +{% include [../../../../../_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} {% endif %} From 4a547d53a190db6032113346fad43455ee2fd6c5 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Fri, 29 Mar 2024 16:59:58 +0300 Subject: [PATCH 06/12] Fixes --- ydb/docs/en/core/_includes/temp_table_description.md | 1 + ydb/docs/ru/core/_includes/temp_table_description.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 ydb/docs/en/core/_includes/temp_table_description.md create mode 100644 ydb/docs/ru/core/_includes/temp_table_description.md diff --git a/ydb/docs/en/core/_includes/temp_table_description.md b/ydb/docs/en/core/_includes/temp_table_description.md new file mode 100644 index 000000000000..743a8af34355 --- /dev/null +++ b/ydb/docs/en/core/_includes/temp_table_description.md @@ -0,0 +1 @@ +`TEMPORARY` / `TEMP` – a temporary table that is automatically deleted at the end of the session. If this parameter is not set (left empty), a permanent table is created. Any indexes created on a temporary table will also be deleted at the end of the session, which means that they are temporary as well. A temporary table and a permanent table with the same name are allowed, in which case a temporary table will be selected. \ No newline at end of file diff --git a/ydb/docs/ru/core/_includes/temp_table_description.md b/ydb/docs/ru/core/_includes/temp_table_description.md new file mode 100644 index 000000000000..b82ef55ac832 --- /dev/null +++ b/ydb/docs/ru/core/_includes/temp_table_description.md @@ -0,0 +1 @@ +`TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при завершении сессии. Если параметр не задан (оставлен пустым) – создается постоянная таблица. Любые индексы, созданные во временных таблицах, также будут удалены при завершении сессиии, что означает, что они тоже являются временными. Допускается существование временной таблицы и постоянной таблицы с одинаковым именем, в этом случае будет выбрана временная таблица. \ No newline at end of file From 44cd26a432d563860aeedbf397af6c5b53c7e174 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Fri, 29 Mar 2024 17:24:34 +0300 Subject: [PATCH 07/12] Fixes --- ydb/docs/en/core/postgresql/statements/create_table.md | 4 ++-- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- ydb/docs/ru/core/postgresql/statements/create_table.md | 4 ++-- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index 9c368d36a296..a9ea7d1fbc98 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -11,8 +11,8 @@ The `CREATE TABLE` statement is used to create an empty table in the current dat When creating a table, you can specify: -1. **Table Type**: {% include [../../_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} -2. **Table Name**: `
` – you can use English letters in lowercase, numbers, and underscores. For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). +1. **Table Type**: {% include [_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} +2. **Table Name**: `
` – you can use English letters in lowercase, numbers, underscores and dollar signs ($). For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). 3. **Column Name**: `` – the same naming rules apply as for table names. 4. **Data Type**: `` – [standard PostgreSQL data types](https://www.postgresql.org/docs/14/datatype.html) are specified. 5. **Collation Rule**: `COLLATE` – [collation rules](https://www.postgresql.org/docs/current/collation.html) allow setting sorting order and character classification features in individual columns or even when performing individual operations. Sortable types include: `text`, `varchar`, and `char`. You can specify the locale (e.g., `en_US`, `ru_RU`) used to determine the sorting and string comparison rules in the specified columns. diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index f2453bef1a7b..5ea92f8f3b0b 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ); ``` -{% include [../../../../../_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} +{% include [_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} {% endif %} diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index f371e48c7c64..4d9cbf2afa84 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -15,8 +15,8 @@ CREATE [TEMPORARY | TEMP] TABLE
( ); ``` При создании таблицы можно задать: -1. **Тип таблицы**: {% include [../../_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} -2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры и нижнее подчёркивание. Например, название таблицы "People" будет сохранено как "people"; +1. **Тип таблицы**: {% include [_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} +2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры, нижнее подчёркивание и знак доллара ($). Например, название таблицы "People" будет сохранено как "people"; 3. **Имя столбца/колонки**: – действую такие же правила нейминга как и для имен таблиц; 4. **Тип данных**: – указываются [стандартные типы](https://www.postgresql.org/docs/current/datatype.html) данных PostgreSQL; 5. **Правило сортировки**: `COLLATE` – [правила сортировки](https://www.postgresql.org/docs/current/collation.html) позволяют устанавливать порядок сортировки и особенности классификации символов в отдельных столбцах или даже при выполнении отдельных операций. К сортируемым типам относятся: `text`, `varchar` и `char`. Можно указать локализацию (`ru_RU`, `en_US`), используемую для определения правил сортировки и сравнения строк в указанных столбцах. diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index 2a947bddd17c..da161f29da97 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ... ); ``` -{% include [../../../../../_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} +{% include [_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} {% endif %} From eb5b5ee1f3d431a77d5ee67a9d042d7a73cb4041 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Fri, 29 Mar 2024 17:51:30 +0300 Subject: [PATCH 08/12] Fixes --- .../{temp_table_description.md => temp-table-description.md} | 0 ydb/docs/en/core/postgresql/statements/create_table.md | 2 +- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- .../{temp_table_description.md => temp-table-description.md} | 0 ydb/docs/ru/core/postgresql/statements/create_table.md | 2 +- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename ydb/docs/en/core/_includes/{temp_table_description.md => temp-table-description.md} (100%) rename ydb/docs/ru/core/_includes/{temp_table_description.md => temp-table-description.md} (100%) diff --git a/ydb/docs/en/core/_includes/temp_table_description.md b/ydb/docs/en/core/_includes/temp-table-description.md similarity index 100% rename from ydb/docs/en/core/_includes/temp_table_description.md rename to ydb/docs/en/core/_includes/temp-table-description.md diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index a9ea7d1fbc98..eaf7b1e75a4c 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -11,7 +11,7 @@ The `CREATE TABLE` statement is used to create an empty table in the current dat When creating a table, you can specify: -1. **Table Type**: {% include [_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} +1. **Table Type**: {% include [temp-table-description.md](../../_includes/temp-table-description.md) %} 2. **Table Name**: `
` – you can use English letters in lowercase, numbers, underscores and dollar signs ($). For example, the table name "People" will be stored as "people". For more information, see [Identifiers and Key Words](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). 3. **Column Name**: `` – the same naming rules apply as for table names. 4. **Data Type**: `` – [standard PostgreSQL data types](https://www.postgresql.org/docs/14/datatype.html) are specified. diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index 5ea92f8f3b0b..a0552ad65317 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ); ``` -{% include [_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} +{% include [temp-table-description.md](../../../../../_includes/temp-table-description.md) %} {% endif %} diff --git a/ydb/docs/ru/core/_includes/temp_table_description.md b/ydb/docs/ru/core/_includes/temp-table-description.md similarity index 100% rename from ydb/docs/ru/core/_includes/temp_table_description.md rename to ydb/docs/ru/core/_includes/temp-table-description.md diff --git a/ydb/docs/ru/core/postgresql/statements/create_table.md b/ydb/docs/ru/core/postgresql/statements/create_table.md index 4d9cbf2afa84..5f3f9f7c71bb 100644 --- a/ydb/docs/ru/core/postgresql/statements/create_table.md +++ b/ydb/docs/ru/core/postgresql/statements/create_table.md @@ -15,7 +15,7 @@ CREATE [TEMPORARY | TEMP] TABLE
( ); ``` При создании таблицы можно задать: -1. **Тип таблицы**: {% include [_includes/temp_table_description.md](../../_includes/temp_table_description.md) %} +1. **Тип таблицы**: {% include [temp-table-description.md](../../_includes/temp-table-description.md) %} 2. **Имя таблицы**: `
` – можно использовать английские буквы в нижнем регистре, цифры, нижнее подчёркивание и знак доллара ($). Например, название таблицы "People" будет сохранено как "people"; 3. **Имя столбца/колонки**: – действую такие же правила нейминга как и для имен таблиц; 4. **Тип данных**: – указываются [стандартные типы](https://www.postgresql.org/docs/current/datatype.html) данных PostgreSQL; diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index da161f29da97..a067bbe2e14e 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ... ); ``` -{% include [_includes/temp_table_description.md](../../../../../_includes/temp_table_description.md) %} +{% include [temp-table-description.md](../../../../../_includes/temp-table-description.md) %} {% endif %} From 23f37af6459c3a48b8cfcb2f353e38a981502ef7 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Fri, 29 Mar 2024 18:11:17 +0300 Subject: [PATCH 09/12] Fixes --- .../yql/reference/yql-core/syntax/_includes/create_table.md | 3 ++- .../yql/reference/yql-core/syntax/_includes/create_table.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index a0552ad65317..03a651846259 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -1,4 +1,5 @@ # CREATE TABLE +# CREATE TABLE {% if feature_olap_tables %} @@ -121,7 +122,7 @@ CREATE TEMPORARY TABLE table_name ( ); ``` -{% include [temp-table-description.md](../../../../../_includes/temp-table-description.md) %} +{% include [temp-table-description.md](../../../../_includes/temp-table-description.md) %} {% endif %} diff --git a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md index a067bbe2e14e..cd5596d0be5a 100644 --- a/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/ru/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -121,7 +121,7 @@ CREATE TEMPORARY TABLE table_name ( ... ); ``` -{% include [temp-table-description.md](../../../../../_includes/temp-table-description.md) %} +{% include [temp-table-description.md](../../../../_includes/temp-table-description.md) %} {% endif %} From f06f153825d7afaccd9181198f1bf3cd77844099 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Mon, 1 Apr 2024 15:34:39 +0300 Subject: [PATCH 10/12] Fixes --- ydb/docs/ru/core/_includes/temp-table-description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/docs/ru/core/_includes/temp-table-description.md b/ydb/docs/ru/core/_includes/temp-table-description.md index b82ef55ac832..d828c1d79684 100644 --- a/ydb/docs/ru/core/_includes/temp-table-description.md +++ b/ydb/docs/ru/core/_includes/temp-table-description.md @@ -1 +1 @@ -`TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при завершении сессии. Если параметр не задан (оставлен пустым) – создается постоянная таблица. Любые индексы, созданные во временных таблицах, также будут удалены при завершении сессиии, что означает, что они тоже являются временными. Допускается существование временной таблицы и постоянной таблицы с одинаковым именем, в этом случае будет выбрана временная таблица. \ No newline at end of file +`TEMPORARY` / `TEMP` – временная таблица, которая автоматически удаляется при завершении сессии. Если параметр не задан (оставлен пустым) – создается постоянная таблица. Любые индексы, созданные во временных таблицах, также будут удалены при завершении сессиии, следовательно они тоже являются временными. Допускается существование временной таблицы и постоянной таблицы с одинаковым именем, в этом случае будет выбрана временная таблица. \ No newline at end of file From 5fd5b812a9380283a109d8ab68b514789bff4271 Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Tue, 2 Apr 2024 15:22:56 +0300 Subject: [PATCH 11/12] Fixes --- .../core/yql/reference/yql-core/syntax/_includes/create_table.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md index 03a651846259..0c39a20338e6 100644 --- a/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md +++ b/ydb/docs/en/core/yql/reference/yql-core/syntax/_includes/create_table.md @@ -1,5 +1,4 @@ # CREATE TABLE -# CREATE TABLE {% if feature_olap_tables %} From c30587009c543b5a8796cbc76f050fd23cba7e2d Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Tue, 2 Apr 2024 15:44:46 +0300 Subject: [PATCH 12/12] Fixes --- ydb/docs/en/core/postgresql/statements/create_table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/docs/en/core/postgresql/statements/create_table.md b/ydb/docs/en/core/postgresql/statements/create_table.md index eaf7b1e75a4c..6da1f6b626b5 100644 --- a/ydb/docs/en/core/postgresql/statements/create_table.md +++ b/ydb/docs/en/core/postgresql/statements/create_table.md @@ -51,7 +51,7 @@ In this example, we created the "people" table with a constraint block (`CONSTRA ## Creating a temporary table {#create_table_temp_table} -{% include [create_table_temp.md](../../../_includes/postgresql/statements/create_table/create_table_temp.md) %} +{% include [create_table_temp.md](../_includes/statements/create_table/create_table_temp.md) %} The temporary table is defined using the `TEMPORARY` or `TEMP` keywords.