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.
#361. Columns of derived tables that name has been given by the system
system catalog base tables onlyFind columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.
#362. Columns of derived tables that name has been given by the system (2)
system catalog base tables onlyFind columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.
#363. Columns that have the same name as some domain/type
INFORMATION_SCHEMA+system catalog base tablesUse different names to avoid confusion.
#364. Columns that have the same name as their domain/type
INFORMATION_SCHEMA+system catalog base tablesFind the columns that name is the same as the name of the type of the column or the domain of the column.
#365. Columns with BYTEA or OID type
INFORMATION_SCHEMA+system catalog base tablesFind columns with BYTEA or OID type. These columns are potentially meant for storing large objects. Each columns should have the most appropriate data type.
#366. Columns with exact/floating numeric types have textual default values
INFORMATION_SCHEMA onlyThe default value of a column should belong to the type of the column. The system shouldn't conduct unnecessary type casts.
#367. Columns with JSON, JSONB, or XML type
INFORMATION_SCHEMA+system catalog base tablesFind columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type.
#368. Columns with only one value
INFORMATION_SCHEMA+system catalog base tablesFind base table columns that contain only one value. Perhaps it is an unnecessary column. Having only one value is most likely inadequate for testing.
#369. Columns with tsvector type
INFORMATION_SCHEMA+system catalog base tablesFind columns of base tables and materialized views that have tsvector type.
#370. Comments of columns
system catalog base tables onlyFind all comments of columns of tables.
#371. Comments of derived tables
system catalog base tables onlyFind 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.
#372. Comments of non-derived tables
system catalog base tables onlyFind 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.
#373. Comments of routines
INFORMATION_SCHEMA+system catalog base tablesFind 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.
#374. Comments of schemas, sequences, types, domains, domain constraints, and event triggers
system catalog base tables onlyFind all the comments that have been added with a COMMENT statement to schemas, sequences, types, domains, and event triggers.
#375. Completely overlapping foreign keys
INFORMATION_SCHEMA+system catalog base tablesFind completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys.
#376. Composite foreign keys
system catalog base tables onlyFind foreign keys that consist of more than one column. Make sure that the order of columns in the composite foreign key corresponds to the order of columns in the composite candidate key in the referenced table.
#377. Composite foreign keys with a mix of mandatory and optional columns
system catalog base tables onlyFind composite foreign keys with a mix of mandatory and optional columns. In case of a composite foreign keys all the columns should either optional or mandatory in order to avoid problems with NULLs.
#378. Composite foreign keys with an incorrect order of columns (ver 1)
system catalog base tables onlyFind composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key consist of columns with the same name but the order of columns in the keys is different. For instance, the query returns information about a foreign key (personal_code, country_code) that refers to the candidate key (country_code, personal_code). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause.
#379. Composite foreign keys with an incorrect order of columns (ver 2)
system catalog base tables onlyFind composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key are not the same in terms of data types of the columns. For instance, the query returns information about a foreign key that columns have the types (SMALLINT, INTEGER) that refers to the candidate key that columns have the types (INTEGER, SMALLINT). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause.
#380. Consistency of CHECK constraint name and content
INFORMATION_SCHEMA onlyFind all CHECK constraints that name contains a digit. Make sure that the name and the Boolean expression are consistent.
| # | Name | Goal | Type | Data source | Last update (sorted descending) | License | Actions |
|---|---|---|---|---|---|---|---|
| 361 | Columns of derived tables that name has been given by the system | Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 362 | Columns of derived tables that name has been given by the system (2) | Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 363 | Columns that have the same name as some domain/type | Use different names to avoid confusion. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 364 | Columns that have the same name as their domain/type | Find the columns that name is the same as the name of the type of the column or the domain of the column. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 365 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 366 | Columns with exact/floating numeric types have textual default values | The default value of a column should belong to the type of the column. The system shouldn't conduct unnecessary type casts. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 367 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 368 | Columns with only one value | Find base table columns that contain only one value. Perhaps it is an unnecessary column. Having only one value is most likely inadequate for testing. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 369 | Columns with tsvector type | Find columns of base tables and materialized views that have tsvector type. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 370 | Comments of columns | Find all comments of columns of tables. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 371 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 372 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 373 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 374 | Comments of schemas, sequences, types, domains, domain constraints, and event triggers | Find all the comments that have been added with a COMMENT statement to schemas, sequences, types, domains, and event triggers. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 375 | Completely overlapping foreign keys | Find completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 376 | Composite foreign keys | Find foreign keys that consist of more than one column. Make sure that the order of columns in the composite foreign key corresponds to the order of columns in the composite candidate key in the referenced table. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 377 | Composite foreign keys with a mix of mandatory and optional columns | Find composite foreign keys with a mix of mandatory and optional columns. In case of a composite foreign keys all the columns should either optional or mandatory in order to avoid problems with NULLs. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 378 | Composite foreign keys with an incorrect order of columns (ver 1) | Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key consist of columns with the same name but the order of columns in the keys is different. For instance, the query returns information about a foreign key (personal_code, country_code) that refers to the candidate key (country_code, personal_code). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 379 | Composite foreign keys with an incorrect order of columns (ver 2) | Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key are not the same in terms of data types of the columns. For instance, the query returns information about a foreign key that columns have the types (SMALLINT, INTEGER) that refers to the candidate key that columns have the types (INTEGER, SMALLINT). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 380 | Consistency of CHECK constraint name and content | Find all CHECK constraints that name contains a digit. Make sure that the name and the Boolean expression are consistent. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) |