Skip to content

Commit 0535344

Browse files
authored
Rename files and add description (#52)
1 parent 0fcb826 commit 0535344

6 files changed

+15
-4
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ Each database structure check starts with an SQL query to the pg_catalog.
1818
psui.indexrelid::regclass::text as index_name,
1919
```
2020
4. All query results must be ordered in some way.
21-
5. Do not forget to update `README.md`.
21+
5. All queries must have a brief description.
22+
Links to documentation or articles with detailed descriptions are welcome.
23+
6. Name of the sql-file with query must correspond to diagnostic name in [Java project](https://github.com/mfvanek/pg-index-health).
24+
7. Do not forget to update `README.md`.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ For more information please see [PostgreSQL Versioning Policy](https://www.postg
3535
11. Tables without [description](https://www.postgresql.org/docs/current/sql-comment.html) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/tables_without_description.sql)).
3636
12. Columns without [description](https://www.postgresql.org/docs/current/sql-comment.html) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/columns_without_description.sql)).
3737
13. Columns with [json](https://www.postgresql.org/docs/current/datatype-json.html) type ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/columns_with_json_type.sql)).
38-
14. Columns of [serial types](https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL) that are not primary keys ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/non_primary_key_columns_with_serial_types.sql)).
38+
14. Columns of [serial types](https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL) that are not primary keys ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/columns_with_serial_types.sql)).
3939
15. Functions without [description](https://www.postgresql.org/docs/current/sql-comment.html) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/functions_without_description.sql)).
4040
16. Indexes [with boolean](https://habr.com/ru/companies/tensor/articles/488104/) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/indexes_with_boolean.sql)).
41-
17. Tables with [not valid constraints](https://habr.com/ru/articles/800121/) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/check_not_valid_constraints.sql)).
41+
17. Tables with [not valid constraints](https://habr.com/ru/articles/800121/) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/not_valid_constraints.sql)).
4242
18. B-tree indexes [on array columns](https://habr.com/ru/articles/800121/) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/btree_indexes_on_array_columns.sql)).
4343
19. [Sequence overflow](https://habr.com/ru/articles/800121/) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/sequence_overflow.sql)).
4444
20. Primary keys with [serial types](https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_serial) ([sql](https://github.com/mfvanek/pg-index-health-sql/blob/master/sql/primary_keys_with_serial_types.sql)).

sql/non_primary_key_columns_with_serial_types.sql renamed to sql/columns_with_serial_types.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
-- Finds columns of serial types (smallserial/serial/bigserial)
99
-- that are not primary keys (or primary and foreign keys at the same time).
10+
--
1011
-- Based on https://dba.stackexchange.com/questions/90555/postgresql-select-primary-key-as-serial-or-bigserial/
1112
select
1213
col.attrelid::regclass::text as table_name,

sql/columns_without_description.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* Licensed under the Apache License 2.0
66
*/
77

8-
-- Finds columns that don't have a description. See also https://www.postgresql.org/docs/current/sql-comment.html
8+
-- Finds columns that don't have a description.
9+
-- See also https://www.postgresql.org/docs/current/sql-comment.html
910
select
1011
t.oid::regclass::text as table_name,
1112
col.attname::text as column_name,

sql/check_not_valid_constraints.sql renamed to sql/not_valid_constraints.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* Licensed under the Apache License 2.0
66
*/
77

8+
-- Finds not validated constraints
9+
--
10+
-- Based on query from https://habr.com/ru/articles/800121/
811
select
912
c.conrelid::regclass::text as table_name, -- Name of the table
1013
c.conname as constraint_name, -- Name of the constraint

sql/sequence_overflow.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* Licensed under the Apache License 2.0
66
*/
77

8+
-- Finds sequences that may overflow in the near future
9+
--
10+
-- Based on query from https://habr.com/ru/articles/800121/
811
with
912
all_sequences as (
1013
select

0 commit comments

Comments
 (0)