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.
#421. Derived tables with string_agg
INFORMATION_SCHEMA+system catalog base tablesFind views and materialized views that use string_agg aggregate function.
#422. Derived table uses a function to get data from another table
INFORMATION_SCHEMA+system catalog base tablesFind views that use a function to get data from another table.
#423. Deterministic (immutable) functions that do not have input parameters
INFORMATION_SCHEMA+system catalog base tablesFind deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input.
#424. Deterministic (immutable) functions that do not return a value
INFORMATION_SCHEMA+system catalog base tablesFind deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions.
#425. Different character maximum lengths that are used to define textual base table columns
INFORMATION_SCHEMA onlyFind the number of different character maximum lengths that are used to define textual base table columns as well as list all the different lengths. Show also the total number of columns with char/varchar type. Maximum character length constrains values in a column. Thus, in case there is a small number of used lengths, it raises a question as to whether the lengths have been optimally selected.
#426. Different data types that are used to define base table columns
INFORMATION_SCHEMA onlyFind the number of different data types that are used to define base table columns as well as list all the different types. Data type constrains values in a column. Thus, in case there is a small number of used types, it raises a question as to whether the types have been optimally selected.
#427. Different foreign key column names in case of referencing the same candidate key
system catalog base tables onlyFind the cases when the names of columns in different foreign keys that reference to the same candidate key are different. If different names reflect different roles, then it is legitimate. However, there could also be accidental differences that makes it more difficult to use the database.
#428. Different non-surrogate key default values
INFORMATION_SCHEMA onlyFind the different default values that implement something other than a surrogate key.
#429. Different prefixes of a candidate key column and a referencing foreign key column
system catalog base tables onlyThe naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different prefixes. Thus, for instance, one cannot use USING syntax for joining the tables.
#430. Different search paths of SECURITY DEFINER functions
INFORMATION_SCHEMA+system catalog base tablesFind the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas.
#431. Different tasks of rules
system catalog base tables onlyFind different tasks that are solved by using rules, i.e., different rules on the same table or different tables that do the same thing are considered to solve one task.
#432. Different tasks of triggers
INFORMATION_SCHEMA+system catalog base tablesFind different tasks that are solved by using triggers, i.e., different triggers on the same table or different tables that do the same thing are considered to solve one task.
#433. Different ways how to find default timestamp values
INFORMATION_SCHEMA onlyFind all the default values of base table, view, and foreign table columns that are expressions invoking a function that returns a timestamp. Do it only if there are different expressions, i.e., there could be possible inconsistencies.
#434. Disabled rules
system catalog base tables onlyIdentify disabled rules. These should be enabled or dropped, otherwise these are dead code.
#435. Disabled system triggers (i.e., disabled enforcement of constraints)
system catalog base tables onlyThese triggers should be enabled because otherwise some important functionality regarding constraints like enforcing referential integrity does not work.
#436. Disabled user triggers
system catalog base tables onlyIdentify disabled triggers. These should be enabled or dropped, otherwise these are dead code.
#437. Domain based on another domain
INFORMATION_SCHEMA+system catalog base tablesFind domains that have been defined based on another domain. Do not specify domains based on existing domains. This would unnecessarily increase dependencies and complexity.
#438. Domain candidates
INFORMATION_SCHEMA+system catalog base tablesFind column descriptions that are candidates for describing a domain.
#439. Domain CHECK constraints with the same name
INFORMATION_SCHEMA onlyFind domain check constraint names that are used more than once (within the same schema or in different schemas). Different things should have different names. However, here different constraints have the same name. Also make sure that this is not a sign of duplication of domains.
#440. Domain declares the same default value for multiple independent foreign keys
INFORMATION_SCHEMA+system catalog base tablesFind domains that declare a default value and that are used in case of multiple foreign key constraints that point to different tables. Domains should be used in a manner that does not cause unnecessary coupling of concerns. For instance, let us assume that columns client_state_type_code of table Client (that is used to implement the relationship with table Client_state_type) and worker_state_type_code of table Worker (that is used to implement the relationship with table Worker_state_type) have been defined based on the same domain. It the domain has a default value, then it determines the initial state of both clients and workers. However, it must be possible to determine the initial state independently in case of clients and workers.
| # | Name | Goal | Type | Data source | Last update (sorted descending) | License | Actions |
|---|---|---|---|---|---|---|---|
| 421 | Derived tables with string_agg | Find views and materialized views that use string_agg aggregate function. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 422 | Derived table uses a function to get data from another table | Find views that use a function to get data from another table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 423 | Deterministic (immutable) functions that do not have input parameters | Find deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 424 | Deterministic (immutable) functions that do not return a value | Find deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 425 | Different character maximum lengths that are used to define textual base table columns | Find the number of different character maximum lengths that are used to define textual base table columns as well as list all the different lengths. Show also the total number of columns with char/varchar type. Maximum character length constrains values in a column. Thus, in case there is a small number of used lengths, it raises a question as to whether the lengths have been optimally selected. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 426 | Different data types that are used to define base table columns | Find the number of different data types that are used to define base table columns as well as list all the different types. Data type constrains values in a column. Thus, in case there is a small number of used types, it raises a question as to whether the types have been optimally selected. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 427 | Different foreign key column names in case of referencing the same candidate key | Find the cases when the names of columns in different foreign keys that reference to the same candidate key are different. If different names reflect different roles, then it is legitimate. However, there could also be accidental differences that makes it more difficult to use the database. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 428 | Different non-surrogate key default values | Find the different default values that implement something other than a surrogate key. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 429 | Different prefixes of a candidate key column and a referencing foreign key column | The naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different prefixes. Thus, for instance, one cannot use USING syntax for joining the tables. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 430 | Different search paths of SECURITY DEFINER functions | Find the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 431 | Different tasks of rules | Find different tasks that are solved by using rules, i.e., different rules on the same table or different tables that do the same thing are considered to solve one task. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 432 | Different tasks of triggers | Find different tasks that are solved by using triggers, i.e., different triggers on the same table or different tables that do the same thing are considered to solve one task. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 433 | Different ways how to find default timestamp values | Find all the default values of base table, view, and foreign table columns that are expressions invoking a function that returns a timestamp. Do it only if there are different expressions, i.e., there could be possible inconsistencies. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 434 | Disabled rules | Identify disabled rules. These should be enabled or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 435 | Disabled system triggers (i.e., disabled enforcement of constraints) | These triggers should be enabled because otherwise some important functionality regarding constraints like enforcing referential integrity does not work. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 436 | Disabled user triggers | Identify disabled triggers. These should be enabled or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 437 | Domain based on another domain | Find domains that have been defined based on another domain. Do not specify domains based on existing domains. This would unnecessarily increase dependencies and complexity. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 438 | Domain candidates | Find column descriptions that are candidates for describing a domain. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 439 | Domain CHECK constraints with the same name | Find domain check constraint names that are used more than once (within the same schema or in different schemas). Different things should have different names. However, here different constraints have the same name. Also make sure that this is not a sign of duplication of domains. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 440 | Domain declares the same default value for multiple independent foreign keys | Find domains that declare a default value and that are used in case of multiple foreign key constraints that point to different tables. Domains should be used in a manner that does not cause unnecessary coupling of concerns. For instance, let us assume that columns client_state_type_code of table Client (that is used to implement the relationship with table Client_state_type) and worker_state_type_code of table Worker (that is used to implement the relationship with table Worker_state_type) have been defined based on the same domain. It the domain has a default value, then it determines the initial state of both clients and workers. However, it must be possible to determine the initial state independently in case of clients and workers. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |