Skip to content

Commit 20dd71c

Browse files
committed
add 6 examples to doc
1 parent 8ac0a11 commit 20dd71c

File tree

6 files changed

+156
-0
lines changed

6 files changed

+156
-0
lines changed

doc/rus/primary_keys_with_serial_types.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,26 @@
2323

2424
Поддерживает секционированные таблицы.
2525
Проверка выполняется на самой секционированной таблице (родительской). Отдельные секции (потомки) игнорируются.
26+
27+
# Скрипт для воспроизведения
28+
29+
```sql
30+
create schema if not exists demo;
31+
create table if not exists demo."table_with_serial_pk"
32+
(
33+
id bigserial not null primary key,
34+
first_name text,
35+
last_name text
36+
);
37+
38+
create table if not exists demo."table_with_serial_pk_partitioned"
39+
(
40+
id bigserial not null,
41+
first_name text,
42+
last_name text
43+
) partition by hash (name);
44+
45+
create table if not exists demo."table_with_serial_pk_partitioned_hash_p0"
46+
partition of demo."table_without_primary_key_partitioned"
47+
for values with (modulus 4, remainder 0);
48+
```

doc/rus/tables_not_linked_to_others.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,23 @@
2020

2121
Поддерживает секционированные таблицы.
2222
Проверка выполняется на самой секционированной таблице (родительской). Отдельные секции (потомки) игнорируются.
23+
24+
# Скрипт для воспроизведения
25+
26+
```sql
27+
create schema if not exists demo;
28+
create table if not exists demo."client_without_fk"
29+
(
30+
id bigint not null primary key,
31+
first_name text,
32+
last_name text
33+
);
34+
35+
create table if not exists demo."account_without_fk_partitioned"
36+
(
37+
id bigint not null primary key,
38+
account_number varchar(50) not null unique,
39+
client_id bigint not null,
40+
created timestamp not null
41+
) partition by range (created);
42+

doc/rus/tables_with_missing_indexes.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,27 @@
2424
## Поддержка секционированных таблиц
2525

2626
Поддерживает секционированные таблицы. Проверка выполняется на каждой секции.
27+
28+
# Скрипт для воспроизведения
29+
30+
```sql
31+
create schema if not exists demo;
32+
create table if not exists demo."table_with_missing_index"
33+
(
34+
id bigint not null primary key,
35+
first_name text,
36+
last_name text
37+
);
38+
39+
create table if not exists demo."table_with_missing_index_partitioned"
40+
(
41+
id int not null primary key,
42+
first_name text,
43+
last_name text
44+
) partition by range (id);
45+
46+
create table if not exists demo."table_with_missing_index_partitioned_1_10"
47+
partition of demo."duplicated_indexes_partitioned"
48+
for values from (1) to (10);
49+
```
50+
Перед проверкой нужно добавить в таблицы данные.

doc/rus/tables_without_description.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,32 @@
1717

1818
Поддерживает секционированные таблицы.
1919
Проверка выполняется на самой секционированной таблице (родительской). Отдельные секции (потомки) игнорируются.
20+
21+
# Скрипт для воспроизведения
22+
23+
```sql
24+
create schema if not exists demo;
25+
26+
create table if not exists demo."table_without_description"
27+
(
28+
id int not null primary key,
29+
first_name text,
30+
last_name text
31+
);
32+
33+
comment on table demo."table_without_description" is ' ';"
34+
35+
create table if not exists demo."table_without_description_partitioned"
36+
(
37+
id int not null primary key,
38+
first_name text,
39+
last_name text
40+
) partition by range (id);
41+
42+
comment on table demo."table_without_description_partitioned" is '';"
43+
44+
create table if not exists demo."table_without_description_partitioned_1_10"
45+
partition of demo."table_without_description"
46+
for values from (1) to (10);
47+
```
48+
Перед проверкой нужно добавить в таблицы данные.

doc/rus/tables_without_primary_key.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,27 @@ PostgreSQL позволяет создавать таблицы без перв
2020

2121
Поддерживает секционированные таблицы.
2222
Проверка выполняется как на самой секционированной таблице (родительской), так и на каждой секции.
23+
24+
# Скрипт для воспроизведения
25+
26+
```sql
27+
create schema if not exists demo;
28+
29+
create table if not exists demo."table_without_primary_key"
30+
(
31+
id bigint not null,
32+
first_name text,
33+
last_name text
34+
);
35+
36+
create table if not exists demo."table_without_primary_key_partitioned"
37+
(
38+
id int not null,
39+
first_name text,
40+
last_name text
41+
) partition by hash (name);
42+
43+
create table if not exists demo."table_without_primary_key_partitioned_hash_p0"
44+
partition of demo."table_without_primary_key_partitioned"
45+
for values with (modulus 4, remainder 0);
46+
```

doc/rus/unused_indexes.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,39 @@ PostgreSQL может никогда не использовать некото
2727
## Поддержка секционированных таблиц
2828

2929
Поддерживает секционированные таблицы. Проверка выполняется на каждой секции.
30+
31+
## Скрипт для воспроизведения
32+
33+
```sql
34+
create schema if not exists demo;
35+
36+
create table if not exists demo."duplicated_indexes"
37+
(
38+
id int not null primary key,
39+
first_name text,
40+
last_name text
41+
);
42+
43+
create index if not exists i_duplicated_indexes_last_first
44+
on demo."duplicated_indexes" (last_name, first_name);
45+
create index if not exists i_duplicated_indexes_last_not_deleted
46+
on demo."duplicated_indexes" (last_name, first_name) where not deleted;
47+
48+
create table if not exists demo."duplicated_indexes_partitioned"
49+
(
50+
id int not null primary key,
51+
first_name text,
52+
last_name text
53+
) partition by range (id);
54+
55+
create index if not exists i_duplicated_indexes_last_first
56+
on demo."duplicated_indexes_partitioned" (last_name, first_name);
57+
create index if not exists i_duplicated_indexes_last_not_deleted
58+
on demo."duplicated_indexes_partitioned" (last_name, first_name) where not deleted;
59+
60+
create table if not exists demo."duplicated_indexes_partitioned_1_10"
61+
partition of demo."duplicated_indexes_partitioned"
62+
for values from (1) to (10);
63+
```
64+
Перед проверкой нужно добавить в таблицы данные.
65+

0 commit comments

Comments
 (0)