Filter Queries

Found 997 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source Last update License
321 Potentially a classifier table is missing (based on field sizes) Find columns that are not covered by a primary key, unique, and foreign key constraint but have a textual type with the maximum field size 3 or less and where the column name does not refer to names or comments. Return only data about these columns where there is no table with a similar name. Return data only about tables that could be referenced from more than one table. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-18 20:08 MIT License View
322 Registration/modification time is not mandatory Find columns that contain registration or modification time but are optional. Problem detection INFORMATION_SCHEMA only 2023-11-26 16:51 MIT License View
323 Perhaps duplicate check of empty strings (ver 2) Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-12-20 11:30 MIT License View
324 Duplicate check of empty strings Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. If there is a constraint description!~'^[[:space:]]*$', then it covers the constraint description!='' and the latter becomes redundant. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-23 14:28 MIT License View
325 Columns defined in a subtable Find columns that have been added to a subtable, i.e., these were not defined in its immediate supertable. General INFORMATION_SCHEMA+system catalog base tables 2021-01-02 03:22 MIT License View
326 Duplicate NOT NULL constraints Find columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
327 Column name contains the table name Find columns that have the same name as the table. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent. General INFORMATION_SCHEMA+system catalog base tables 2023-01-06 12:38 MIT License View
328 Column name is the same as the table name Find columns that have the same name as the table. The names may have different uppercase/lowercase characters. Sometimes columns with such names are used as the key columns. Make sure that the naming style is consistent. General INFORMATION_SCHEMA+system catalog base tables 2023-01-06 12:38 MIT License View
329 Perhaps the type of a base table column/domain should be SMALLINT (based on classifiers) Find columns that name points to the possibility that values in this are classifier codes. The column has a numeric type but it is not SMALLINT. Usually each classifier type has so few values that type SMALLINT would be appropriate. Problem detection INFORMATION_SCHEMA only 2024-11-28 13:23 MIT License View
330 Password is unique Find columns that potentially contains passwords and that participate in a unique constraint or index Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-06-09 13:21 MIT License View
331 Storing file content in the database Find columns that probably store content of files in the database. General INFORMATION_SCHEMA only 2021-03-27 17:02 MIT License View
332 NOT NULL constraint via CHECK instead of NOT NULL constraint Find columns where the NOT NULL constraint has been added with the help of an explicit CHECK constraints instead of a NOT NULL constraint. One should note that internally NOT NULL constraints are treated as a kind of CHECK constraints. Nevertheless, the design should be consistent (i.e., NOT NULL is enforced with the same way in different places). Problem detection INFORMATION_SCHEMA only 2024-12-12 09:42 MIT License View
333 Columns with array or user-defined type Find columns with an array or a user-defined type. Each columns should have the most appropriate data type. General INFORMATION_SCHEMA+system catalog base tables 2020-11-19 17:04 MIT License View
334 Precision of a timestamp or a time column is too big Find columns with a timestamp or a time type where the precision (the permitted maximum number of fractional sections) is bigger than the precision in the default value of the column. Problem detection INFORMATION_SCHEMA only 2023-11-02 17:29 MIT License View
335 Columns with BYTEA or OID type Find columns with BYTEA or OID type. These columns are potentially meant for storing large objects. Each columns should have the most appropriate data type. General INFORMATION_SCHEMA+system catalog base tables 2020-11-19 17:00 MIT License View
336 Columns with JSON, JSONB, or XML type Find columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type. General INFORMATION_SCHEMA+system catalog base tables 2020-11-19 17:01 MIT License View
337 YELLING IN COMMENTS! Find comments of derived tables and routines that consist of only uppercase letters. Do not use only uppercase (capital) letters in order to write comments. It means yelling and also makes text less readable. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-04-25 15:13 MIT License View
338 Comments of derived tables Find comments of derived tables (views and materialized views) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, triggers, rules). Make sure that the comments give relevant, useful, and correct information. General system catalog base tables only 2023-01-19 12:14 MIT License View
339 Comments of non-derived tables Find comments of non-derived tables (base tables, foreign tables, and partitioned tables) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, constraints, indexes, triggers, rules). Make sure that the comments give relevant, useful, and correct information. General system catalog base tables only 2023-01-19 12:30 MIT License View
340 Comments of routines Find comments of user-defined routines (functions or procedures) that are registered in the system catalog witht a COMMENT statement. Make sure that the comments give relevant, useful, and correct information. General INFORMATION_SCHEMA+system catalog base tables 2020-11-06 14:51 MIT License View