Filter Queries
Found 1053 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.
#61. Base tables with multiple comment columns
INFORMATION_SCHEMA onlyFind base tables with more than one comment columns
#62. Base tables with multiple name columns
INFORMATION_SCHEMA onlyFind base tables with more than one name columns. Perhaps the normalization level of the table is low.
#63. Base tables with multiple temporal columns
INFORMATION_SCHEMA onlyFind base tables that have more than one column with a temporal type (date or timestamp).
#64. Base tables with plenty of data
system catalog base tables onlyFind base tables that have 1000 rows or more.
#65. Base tables with the biggest number of rows
system catalog base tables onlyFind the base tables that belong to the top 5 in terms of the number of rows in the table. There should be test data in the tables.
#66. Candidate keys and foreign keys of tables that participate in an inheritance hierarchies
system catalog base tables onlyFind primary key, unique, foreign key, and exclude constraints that have been defined in tables that participate in an inheritance hierarchy. Do not forget to redefine the constraints that are defined on supertables also on their subtables.
#67. Case insensitive search
INFORMATION_SCHEMA+system catalog base tablesRefers to the column pg_proc.prokind and thus works starting from PostgreSQL 11. Find user-defined routines and derived tables (views/materialized views) that have a subquery with case insensitive search (by using the upper or lower function or ILIKE predicate or (?i) modifier of a regular expression pattern).
#68. Chains of ON DELETE CASCADE
system catalog base tables onlyThis query identifies referential paths (chains of foreign key relationships) where every constraint in the path is configured with ON DELETE CASCADE. The analysis is intended to uncover potential transitive deletion risks, where a single DELETE operation on a root table could trigger a catastrophic, cascading data loss across multiple, deeply-nested tables. The length of such chains is a key indicator of architectural fragility.
#69. Check as to wheteher the names of columns are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming.
#70. Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#71. Check as to wheteher the names of parameters are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#72. Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#73. Check as to wheteher the names of tables are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#74. Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#75. CHECK constraints on columns with Boolean data
INFORMATION_SCHEMA onlyFind check constraints that involve columns with the type Boolean.
#76. CHECK constraints on columns with personal names
INFORMATION_SCHEMA onlyThis query identifies CHECK constraints applied to base or foreign table columns that store personal names. It flags these constraints for review to ensure they are not overly strict. Many regular expressions or character limits fail to account for the complexity of real-world names (such as those containing apostrophes, hyphens, or diacritics), thereby inadvertently preventing the registration of valid legal names.
#77. CHECK constraints on columns with temporal data
INFORMATION_SCHEMA onlyIf your table contains columns with temporal data, then it will be appropriate to restrict the range of possible values in these columns because some of the values that belong to the type might not be appropriate (for instance, imagine a client who was born in 1100-12-03 or a contract that was registered in 3890-12-12- 12:45). If your table contains multiple columns with temporal data that denote events, then the rule about the order of the events must be enforced, if possible.
#78. CHECK constraints that use non-deterministic functions
INFORMATION_SCHEMA onlyDiscover incorrect usage of non-deterministic functions in CHECK constraints. Find base table columns and foreign table columns that have a CHECK constraint that refers to a non-deterministic function that returns current date/time/timestamp.
#79. CHECK constraints with the cardinality bigger than one
system catalog base tables onlyFind multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger.
#80. CHECK constraints with the cardinality bigger than one that involve the same set of columns
system catalog base tables onlyCHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.
| # | Name | Goal | Type (sorted ascending) | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 61 | Base tables with multiple comment columns | Find base tables with more than one comment columns | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 62 | Base tables with multiple name columns | Find base tables with more than one name columns. Perhaps the normalization level of the table is low. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 63 | Base tables with multiple temporal columns | Find base tables that have more than one column with a temporal type (date or timestamp). | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 64 | Base tables with plenty of data | Find base tables that have 1000 rows or more. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 65 | Base tables with the biggest number of rows | Find the base tables that belong to the top 5 in terms of the number of rows in the table. There should be test data in the tables. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 66 | Candidate keys and foreign keys of tables that participate in an inheritance hierarchies | Find primary key, unique, foreign key, and exclude constraints that have been defined in tables that participate in an inheritance hierarchy. Do not forget to redefine the constraints that are defined on supertables also on their subtables. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 67 | Case insensitive search | Refers to the column pg_proc.prokind and thus works starting from PostgreSQL 11. Find user-defined routines and derived tables (views/materialized views) that have a subquery with case insensitive search (by using the upper or lower function or ILIKE predicate or (?i) modifier of a regular expression pattern). | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 68 | Chains of ON DELETE CASCADE | This query identifies referential paths (chains of foreign key relationships) where every constraint in the path is configured with ON DELETE CASCADE. The analysis is intended to uncover potential transitive deletion risks, where a single DELETE operation on a root table could trigger a catastrophic, cascading data loss across multiple, deeply-nested tables. The length of such chains is a key indicator of architectural fragility. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 69 | Check as to wheteher the names of columns are in the plural or in the singular form (English version) | Check as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 70 | Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 71 | Check as to wheteher the names of parameters are in the plural or in the singular form (English version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 72 | Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 73 | Check as to wheteher the names of tables are in the plural or in the singular form (English version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 74 | Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 75 | CHECK constraints on columns with Boolean data | Find check constraints that involve columns with the type Boolean. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 76 | CHECK constraints on columns with personal names | This query identifies CHECK constraints applied to base or foreign table columns that store personal names. It flags these constraints for review to ensure they are not overly strict. Many regular expressions or character limits fail to account for the complexity of real-world names (such as those containing apostrophes, hyphens, or diacritics), thereby inadvertently preventing the registration of valid legal names. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 77 | CHECK constraints on columns with temporal data | If your table contains columns with temporal data, then it will be appropriate to restrict the range of possible values in these columns because some of the values that belong to the type might not be appropriate (for instance, imagine a client who was born in 1100-12-03 or a contract that was registered in 3890-12-12- 12:45). If your table contains multiple columns with temporal data that denote events, then the rule about the order of the events must be enforced, if possible. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 78 | CHECK constraints that use non-deterministic functions | Discover incorrect usage of non-deterministic functions in CHECK constraints. Find base table columns and foreign table columns that have a CHECK constraint that refers to a non-deterministic function that returns current date/time/timestamp. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 79 | CHECK constraints with the cardinality bigger than one | Find multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 80 | CHECK constraints with the cardinality bigger than one that involve the same set of columns | CHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) |