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.
#281. Base table columns permitting e-mail addresses without @ sign
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited.
#282. Base table columns permitting negative prices/quantity
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited.
#283. Base table columns permitting temporal values that may be outside the range of logical values
INFORMATION_SCHEMA+system catalog base tablesFind base tables columns with temporal types (date and timestamp) that do not belong to a foreign key and that do not have any associated simple CHECK constraints, i.e., constraint that involves only one column. For instance, in the column registration_time that does not have any associated CHECK constraints could be values '1200-01-01 00:00' or '5900-12-31 00:00'. Rows with these values most probably represent wrong propositions and the system should restrict registration of such data.
#284. Base table columns permitting URLs without a protocol
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited.
#285. Base table columns where TOASTing is possible
system catalog base tables onlyFind all base table columns in case of which the system can use TOAST technique.
#286. Base table columns where TOAST-ing strategy has been changed
system catalog base tables onlyFind base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed so that it is different than the default strategy determined by the type. Make sure that the new strategy is optimal.
#287. Base table columns where TOAST-ing strategy has been changed to plain
system catalog base tables onlyFind base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row.
#288. Base table columns with a composite type
system catalog base tables onlyFind base table columns with a composite type. Think through as to whether a column with a composite type could be replaced with a separate table.
#289. Base table columns with an array type
INFORMATION_SCHEMA+system catalog base tablesFind base table columns with an array type. Think through as to whether a column with an array type could be replaced with a separate table.
#290. Base table columns with CHAR(n) or VARCHAR(n) type
INFORMATION_SCHEMA onlyFind base table columns with CHAR(n) or VARCHAR(n) type and make sure that n is not too big or too small. Also make sure that you do not use CHAR(n) in case of columns that have to keep variable length strings. "Values of type character are physically padded with spaces to the specified width n, and are stored and displayed that way" (https://www.postgresql.org/docs/current/datatype-character.html)
#291. Base table columns with CITEXT type
system catalog base tables onlyFind base table columns with CITEXT type and make sure that case insensitivity is really needed in case of this column.
#292. Base table columns with DECIMAL (p, s) or NUMERIC (p, s) type
INFORMATION_SCHEMA onlyFind base table columns with DECIMAL (p, s) or NUMERIC (p, s) type and make sure that precision p and scale s are not too big or too small.
#293. Base table columns with one of the following types: BIGINT, INTEGER, TEXT, or VARCHAR without max character length
INFORMATION_SCHEMA onlyEach column should have the most appropriate data type. Developers sometimes misuse BIGINT, INTEGER, TEXT or VARCHAR type in places where a type that permits smaller values would be more appropriate and semantically descriptive.
#294. Base table columns with SMALLINT or BOOLEAN type
INFORMATION_SCHEMA onlyEach column should have the most appropriate data type. Developers sometimes forget to use SMALLINT type even if it is logically the best choice. Developers also sometimes forget to use BOOLEAN type and instead invent something.
#295. Base table columns with the same name and type have different field sizes
INFORMATION_SCHEMA onlyFind base table columns that have the same name and type but different field size.
#296. Base table columns with the type VARCHAR(1)
INFORMATION_SCHEMA onlyThe choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string.
#297. Base table columns with UUID type
INFORMATION_SCHEMA onlyEach column should have the most appropriate data type. If one does not want to have in a table the surrogate key that values are generated by using a sequence generator, then one may use instead a column with Universally Unique Identifiers as the key column.
#298. Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns
INFORMATION_SCHEMA+system catalog base tablesIdentify possibly missing CHECK constraints.
#299. Base tables and foreign tables that have no CHECK constraints
INFORMATION_SCHEMA onlyWhat are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints.
#300. Base tables and materialized views without any index
INFORMATION_SCHEMA+system catalog base tablesFind base tables and materialized views that do not have any index.
| # | Name | Goal | Type | Data source | Last update (sorted descending) | License | Actions |
|---|---|---|---|---|---|---|---|
| 281 | Base table columns permitting e-mail addresses without @ sign | Find non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 282 | Base table columns permitting negative prices/quantity | Find non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 283 | Base table columns permitting temporal values that may be outside the range of logical values | Find base tables columns with temporal types (date and timestamp) that do not belong to a foreign key and that do not have any associated simple CHECK constraints, i.e., constraint that involves only one column. For instance, in the column registration_time that does not have any associated CHECK constraints could be values '1200-01-01 00:00' or '5900-12-31 00:00'. Rows with these values most probably represent wrong propositions and the system should restrict registration of such data. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 284 | Base table columns permitting URLs without a protocol | Find non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 285 | Base table columns where TOASTing is possible | Find all base table columns in case of which the system can use TOAST technique. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 286 | Base table columns where TOAST-ing strategy has been changed | Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed so that it is different than the default strategy determined by the type. Make sure that the new strategy is optimal. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 287 | Base table columns where TOAST-ing strategy has been changed to plain | Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 288 | Base table columns with a composite type | Find base table columns with a composite type. Think through as to whether a column with a composite type could be replaced with a separate table. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 289 | Base table columns with an array type | Find base table columns with an array type. Think through as to whether a column with an array type could be replaced with a separate table. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 290 | Base table columns with CHAR(n) or VARCHAR(n) type | Find base table columns with CHAR(n) or VARCHAR(n) type and make sure that n is not too big or too small. Also make sure that you do not use CHAR(n) in case of columns that have to keep variable length strings. "Values of type character are physically padded with spaces to the specified width n, and are stored and displayed that way" (https://www.postgresql.org/docs/current/datatype-character.html) | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 291 | Base table columns with CITEXT type | Find base table columns with CITEXT type and make sure that case insensitivity is really needed in case of this column. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 292 | Base table columns with DECIMAL (p, s) or NUMERIC (p, s) type | Find base table columns with DECIMAL (p, s) or NUMERIC (p, s) type and make sure that precision p and scale s are not too big or too small. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 293 | Base table columns with one of the following types: BIGINT, INTEGER, TEXT, or VARCHAR without max character length | Each column should have the most appropriate data type. Developers sometimes misuse BIGINT, INTEGER, TEXT or VARCHAR type in places where a type that permits smaller values would be more appropriate and semantically descriptive. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 294 | Base table columns with SMALLINT or BOOLEAN type | Each column should have the most appropriate data type. Developers sometimes forget to use SMALLINT type even if it is logically the best choice. Developers also sometimes forget to use BOOLEAN type and instead invent something. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 295 | Base table columns with the same name and type have different field sizes | Find base table columns that have the same name and type but different field size. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 296 | Base table columns with the type VARCHAR(1) | The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 297 | Base table columns with UUID type | Each column should have the most appropriate data type. If one does not want to have in a table the surrogate key that values are generated by using a sequence generator, then one may use instead a column with Universally Unique Identifiers as the key column. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 298 | Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns | Identify possibly missing CHECK constraints. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 299 | Base tables and foreign tables that have no CHECK constraints | What are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 300 | Base tables and materialized views without any index | Find base tables and materialized views that do not have any index. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |