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.
#541. SQL function does not return a value
INFORMATION_SCHEMA+system catalog base tablesFind SQL functions that do not return a value (return VOID) but the SQL statement in the function has RETURNING clause.
#542. Multiple RETURNING clauses in a SQL function
INFORMATION_SCHEMA+system catalog base tablesFind SQL functions that have multiple statements with the RETURNING clause.
#543. The SQL-language routines with the body that is string literal
INFORMATION_SCHEMA+system catalog base tablesFind SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14.
#544. Incorrect characterization of a user-defined routine as a "stable" routine
INFORMATION_SCHEMA+system catalog base tablesFind stable routines that contain INSERT, UPDATE, DELETE, SELECT … FOR UPDATE, or LOCK statement. The DBMS should get a correct background information about the behaviour of a routine. Stable routines cannot modify data in a database, lock tables, or its specific rows.
#545. STATEMENT level triggers that refer to the values of row variables NEW or OLD
INFORMATION_SCHEMA+system catalog base tablesFind STATEMENT level triggers that refer to the values of row variables NEW or OLD. NEW and OLD are special variables that can only be used in row-level trigger procedures.
#546. Number of using views
INFORMATION_SCHEMA+system catalog base tablesFind statistics about how many base tables have how many derived tables that use these tables.
#547. Number of used tables
INFORMATION_SCHEMA+system catalog base tablesFind statistics about how many derived tables have how many different underlying tables.
#548. Subqueries of derived tables with LIMIT/FETCH/DISTINCT ON without ORDER BY
INFORMATION_SCHEMA+system catalog base tablesFind subqueries of derived tables (views, materialized views) with the LIMIT/FETCH clause or with DISTINCT ON construct but without the ORDER BY clause. These constructs require sorting to produce a meaningful result.
#549. Potentially missing sequence generators (based on column names and types)
INFORMATION_SCHEMA+system catalog base tablesFind surrogate key columns that do not have an associated sequence generator. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys.
#550. Surrogate key columns that do not follow the naming style
INFORMATION_SCHEMA+system catalog base tablesFind surrogate key columns that name does not end with "id_" or start with "id_".
#551. Surrogate key columns
INFORMATION_SCHEMA+system catalog base tablesFind surrogate keys. Surrogate key is a key that consist of one column, which has an integer type. The key has been declared by using PRIMARY KEY or UNIQUE constraint. The column is associated with a sequence generator (either external or internal, i.e., created by the system automatically because the column has been declared as an identity column). The column does not participate in any foreign key.
#552. The generator of surrogate key values can output the same value more than once
INFORMATION_SCHEMA+system catalog base tablesFind surrogate keys where the generator can output the same value more than once. Key values must be unique, i.e., at some point the generator will prevent adding new rows to the table.
#553. All system-defined TOAST-able types
system catalog base tables onlyFind system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).
#554. Perhaps an overcomplicated constraint expression that compares the result of a Boolean expression with a Boolean value
INFORMATION_SCHEMA+system catalog base tablesFind table and domain CHECK constraints that compare the result of a Boolean expression with a Boolean value. If you can choose between two logically equivalent Boolean expressions choose the more simple expression.
#555. CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the column
INFORMATION_SCHEMA onlyFind table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces).
#556. Inconsistency between the type and the default value of a column (date and timestamp values)
INFORMATION_SCHEMA onlyFind table columns with timestamp/date types that data type and dynamically found default value have a different type.
#557. Inconsistency between the type and the default value of a column (time values)
INFORMATION_SCHEMA onlyFind table columns with time types, which data type and dynamically found default value have a different type.
#558. Too generic names (table constraints)
system catalog base tables onlyFind table constraints (constraints that are associated directly with the table) that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name.
#559. A non-parameterized table function instead of a view
INFORMATION_SCHEMA+system catalog base tablesFind table functions that do not have any parameters. Prefer simpler and more portable solutions.
#560. Table functions with OFFSET
INFORMATION_SCHEMA+system catalog base tablesFind table functions that use OFFSET. OFFSET method is a common way for implementing pagination.
| # | Name | Goal (sorted ascending) | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 541 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 542 | Multiple RETURNING clauses in a SQL function | Find SQL functions that have multiple statements with the RETURNING clause. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 543 | The SQL-language routines with the body that is string literal | Find SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 544 | Incorrect characterization of a user-defined routine as a "stable" routine | Find stable routines that contain INSERT, UPDATE, DELETE, SELECT … FOR UPDATE, or LOCK statement. The DBMS should get a correct background information about the behaviour of a routine. Stable routines cannot modify data in a database, lock tables, or its specific rows. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 545 | STATEMENT level triggers that refer to the values of row variables NEW or OLD | Find STATEMENT level triggers that refer to the values of row variables NEW or OLD. NEW and OLD are special variables that can only be used in row-level trigger procedures. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 546 | Number of using views | Find statistics about how many base tables have how many derived tables that use these tables. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 547 | Number of used tables | Find statistics about how many derived tables have how many different underlying tables. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 548 | Subqueries of derived tables with LIMIT/FETCH/DISTINCT ON without ORDER BY | Find subqueries of derived tables (views, materialized views) with the LIMIT/FETCH clause or with DISTINCT ON construct but without the ORDER BY clause. These constructs require sorting to produce a meaningful result. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 549 | Potentially missing sequence generators (based on column names and types) | Find surrogate key columns that do not have an associated sequence generator. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 550 | Surrogate key columns that do not follow the naming style | Find surrogate key columns that name does not end with "id_" or start with "id_". | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 551 | Surrogate key columns | Find surrogate keys. Surrogate key is a key that consist of one column, which has an integer type. The key has been declared by using PRIMARY KEY or UNIQUE constraint. The column is associated with a sequence generator (either external or internal, i.e., created by the system automatically because the column has been declared as an identity column). The column does not participate in any foreign key. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 552 | The generator of surrogate key values can output the same value more than once | Find surrogate keys where the generator can output the same value more than once. Key values must be unique, i.e., at some point the generator will prevent adding new rows to the table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 553 | All system-defined TOAST-able types | Find system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table). | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 554 | Perhaps an overcomplicated constraint expression that compares the result of a Boolean expression with a Boolean value | Find table and domain CHECK constraints that compare the result of a Boolean expression with a Boolean value. If you can choose between two logically equivalent Boolean expressions choose the more simple expression. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 555 | CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the column | Find table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces). | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 556 | Inconsistency between the type and the default value of a column (date and timestamp values) | Find table columns with timestamp/date types that data type and dynamically found default value have a different type. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 557 | Inconsistency between the type and the default value of a column (time values) | Find table columns with time types, which data type and dynamically found default value have a different type. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 558 | Too generic names (table constraints) | Find table constraints (constraints that are associated directly with the table) that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 559 | A non-parameterized table function instead of a view | Find table functions that do not have any parameters. Prefer simpler and more portable solutions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 560 | Table functions with OFFSET | Find table functions that use OFFSET. OFFSET method is a common way for implementing pagination. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |