Filter Queries

Found 1018 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
781 Simple check constraints with multiple tasks Find simple check constraints, i.e., check constraints that cover one column that seem to have multiple tasks. The corresponding code smell in case of cleaning code is "G30: Functions Should Do One Thing". (Robert C. Martin, Clean Code) Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
782 Simple natural primary keys Find primary keys that consist of one column and that values are not generated by the system. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
783 Simple primary keys that column name does not contain the table name Find simple primary keys that column name does not contain the table name. The naming should be clear and consistent. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
784 Small tables Find tables that have one column or zero columns. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
785 Some candidate key values cannot be used as foreign key values Find foreign key constraints in case of which some candidate key values cannot be used as foreign key values. Primary key/unique columns and foreign key columns should have the same data type and field size. If, for instance, the primary key column has type INTEGER and foreign key column has type SMALLINT, then one cannot use all the primary key values as foreign key values. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
786 Some CHECKS are associated with a domain and some with the base table columns that have the domain Find cases where some CHECKS are associated with a domain and some with the base table columns that have the domain. Avoid duplication of code. Write as little code as possible. If possible, move things "before the brackets" so to say. In this case it means declaring CHECKS at the level of the domain and not at the level of base table columns. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
787 Some data modification functions return a value and some not Find as to whether there are data modification routines that return a value as well as data modification routines that do not return a value. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
788 Something is still to do in routines Find routines where comments contain TODO phrase. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
789 Sometimes CHECK, sometimes not Find cases where the column with the same name in different tables sometimes has a check constraint and sometimes not. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
790 Sometimes current_timestamp, sometimes now() Find as to whether you sometimes use current_timestamp function and sometimes now() function. These implement the same functionality. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
791 Sometimes extract, sometimes date_part Find as to whether you sometimes use date_part function and sometimes extract function. These implement the same functionality. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
792 Sometimes regexp_like, sometimes ~ Find as to whether you sometimes use regexp_like function and sometimes ~ operator. These implement the same functionality. regexp_like function that was added to PostgreSQL 15 and provides the same functionality as ~ and ~* operators. Try to be consistent. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
793 Sorting rows based on random values in derived tables Find derived tables (views and materialized views) that sort rows based on random values. This can be used to find a random subset of rows. It is a computationally expensive operation. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
794 Sorting rows based on random values in derived tables without limiting rows Find derived tables (views and materialized views) that sort rows based on random values but do not limit the number of rows. This is unnecessary because without sorting the rows are returned in a unspecified order. Sorting based on random values is a computationally expensive operation. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
795 Sorting rows based on random values in routines Find routines that contain a statement that sorts rows based on random values. This can be used to find a random subset of rows. It is a computationally expensive operation. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
796 Sorting rows based on random values in routines without limiting rows Find routines that contain a statement that sorts rows based on random values but do not limit the number of rows. This is unnecessary because without sorting the rows are returned in a unspecified order. Sorting based on random values is a computationally expensive operation. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
797 SQL function does not return a value Find SQL functions that do not return a value (return VOID) but the SQL statement in the function has RETURNING clause. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
798 SQL functions that use optimistic approach for locking but do not return a value Find SQL functions that use a hidden column of PostgreSQL tables - xmin - to implement optimistic locking but do not return any information to the invoker of the functions, i.e., whether the update/delete operation succeeded or not. The functions should let their invokers know as to whether the function succeeded in updating or deleting a row. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
799 SQL routines that return the value of an input parameter Find SQL routines that return the value of an input parameter. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
800 STATEMENT level triggers and ROW level AFTER triggers without RETURN NULL Write correct code "The return value of a row-level trigger fired AFTER or a statement-level trigger fired BEFORE or AFTER is always ignored; it might as well be null." (PostgreSQL documentation) Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View