Catalog of PostgreSQL queries for finding information about a PostgreSQL database and its design problems

AND
AND
AND
ANDFrom where does the query gets its information?
AND
AND

There are 961 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
241Base table columns for recording geographic coordinates that do not have a suitable type (based on column names)Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point).Problem detectionINFORMATION_SCHEMA only2021-10-08 12:01MIT License
242Base table columns permitting e-mail addresses without @ signFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
243Base table columns permitting empty strings and strings that consist of only whitespace charactersFind non-foreign key columns of base tables that have a textual type and do not have any simple CHECK constraint, i.e., a constraint that involves only one column. Such columns can contain the empty string and strings that consist of only whitespace.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
244Base table columns permitting empty strings and strings that consist of only whitespace characters (2)Find non-foreign key columns of base tables that have a textual type and do not have a simple CHECK constraint (i.e., a constraint that involves only one column) that seems to prohibit empty strings and strings that consist of only whitespace as well as a simple CHECK constraint that specifies permitted symbols.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-02 16:52MIT License
245Base table columns permitting negative prices/quantityFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-10-06 14:14MIT License
246Base table columns permitting telephone numbers without digitsFind non-foreign key base table columns that name refers to the possibility that these are used to register phone numbers. Find the columns that do not have any simple CHECK constraint that references to the character class of digits. A simple check constraint covers a single column. In this case registration of e-mail addresses without digits is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:52MIT License
247Base table columns permitting temporal values that may be outside the range of logical valuesFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-12-17 00:40MIT License
248Base table columns permitting URLs without a protocolFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 13:13MIT License
249Base table columns where TOAST-ing strategy has been changed to plainFind 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 detectionsystem catalog base tables only2021-02-25 17:29MIT License
250Base table columns with the same name and type have different field sizesFind base table columns that have the same name and type but different field size.Problem detectionINFORMATION_SCHEMA only2021-03-28 16:59MIT License
251Base table columns with the same name have different typesFind base table columns that have the same name but different type. In general, base tables columns that have the same name should have the same type as well.Problem detectionINFORMATION_SCHEMA only2023-01-14 20:54MIT License
252Base 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 detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
253Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columnsIdentify possibly missing CHECK constraints.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
254Base tables and foreign tables that have no CHECK constraintsWhat 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 detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
255Base tables and materialized views without any indexFind base tables and materialized views that do not have any index.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-05 19:39MIT License
256Base tables that have a surrogate key and all its unique constraints have an optional columnA surrogate key is a primary key that consist of one column. The values of this column do not have any meaning for the user and the system usually generates the values (integers) automatically. In case of defining a surrogate key in a table it is a common mistake to forget declaring existing natural keys in the table. If a key covers an optional column then it does not prevent duplicate rows where some values are missing and other values are equal. Because NULL is not a value and is not duplicate of another NULL the, follwing is possible: CREATE TABLE Uniq(a INTEGER NOT NULL,
b INTEGER,
CONSTRAINT ak_uniq UNIQUE (a, b));

INSERT INTO Uniq(a, b) VALUES (1, NULL);
INSERT INTO Uniq(a, b) VALUES (1, NULL);
Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-21 11:54MIT License
257Base tables that have a surrogate key and do not have any uniqueness constraintsA surrogate key is a key that consist of one column. The values of this column do not have any meaning for the user and the system generates the values (integers) automatically. In case of defining a surrogate key in a table it is a common mistake to forget declaring existing natural keys in the table. The query discards tables with only one column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-26 17:47MIT License
258Base tables that have a unique constraint but not the primary keyA common style is to declare in each base table one of the candidate keys as the primary key. All the other candidate keys would be alternate keys that will be enforce with the help of UNIQUE + NOT NULL constraints.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
259Base tables that have more than five indexesFind base tables that have more than five indexes. Indexes can be used to increase the speed of queries (SELECT statements). However, the amount of indexes shouldn't be too large. Otherwise it may reduce the speed of operations that are used to modify data.Problem detectionsystem catalog base tables only2022-10-21 10:33MIT License
260Base tables that have neither a unique constraint nor the primary keyFind base tables without any unique constraints and the primary key. In such tables there are no restrictions for recording duplicate rows. Each row represents a true proposition about the real world. It does not make the proposition truer if one presents it more than once. Moreover, duplicate rows increase data size. Without keys the DBMS lacks vital information about data in the database that it can internally use to choose better execution plans and in this way improve performance of database operations. The only legitimate reason of such a table is if it is an abstract table that is used to define common columns of subtables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License