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...
561Deferrable constraintsFind all deferrable constraints.Generalsystem catalog base tables only2021-10-08 11:25MIT License
562Initially deferred constraint triggers with unnecessary lockingInitially deferred constraint triggers do not need explicit statements for locking tables or rows.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-08 11:25MIT License
563Base tables with multiple comment columnsFind base tables with more than one comment columnsGeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
564Base tables with multiple name columnsFind base tables with more than one name columns. Perhaps the normalization level of the table is low.GeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
565Using an internal data type - nameFind base table columns that use type name that is used in system catalog tables. It is not a problem if the column is meant for recording identifiers of database objects.GeneralINFORMATION_SCHEMA only2021-03-30 13:36MIT License
566Inconsistent precision and scale usage in case of registering sums of moneyFind as to whether different precisions/scales are used in case of registering data about sums of money in different columns.Problem detectionINFORMATION_SCHEMA only2021-03-29 13:07MIT License
567Registration/modification time is not automatically setFind columns of base tables that name and type suggest that the column should contain the row registration time or last modify time but the column does not have a default value.Problem detectionINFORMATION_SCHEMA only2021-03-28 17:36MIT License
568Base 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
569Perhaps the type of a base table column should be XML, JSON, or JSONB (based on column names)Find base table columns that name refers to the possibility that these are used to register XML/JSON values. Find the columns that do not have an appropriate data type (xml, json, jsonb). One shouldn't use columns with a textual type to register such data.Problem detectionINFORMATION_SCHEMA only2021-03-28 15:30MIT License
570Inconsistency between the name and the type of a base table column (timestamps)Find base table columns that name refers to the possibility that these are used to register timestamps. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column type is "timestamp", then the suffix of the column name should be "aeg" (Estonian) or "time" (English).Problem detectionINFORMATION_SCHEMA only2021-03-28 15:12MIT License
571Many-to-many relationship types that do not permit repeating relationships and do not have additional attributesFind base tables that implement many-to-many relationship types that do not permit repeating relationships. More specifically find tables that have two or more foreign keys and all the columns of the table belong to a foreign key. In addition, all the table columns must be covered by a primary key or unique constraint. It could be that during the system analysis a mistake has been made and some attributes of the entity type that represents the relationship type have not been discovered.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-28 12:04MIT License
572Phone number column has an incorrect data typeFind the columns where the name reffers to the possibility that the column contains phone numbers but the type of the column is not VARCHAR or TEXT.Problem detectionINFORMATION_SCHEMA only2021-03-27 19:00MIT License
573Field size is not sufficiently different in case of base table columnsFind base table columns that name refers to the possibility that these are used to register names. Find base table columns that name refers to the possibility that these are used to register comments/descriptions/etc. Find the cases where a base table contains columns from the both sets and the field size in case of the latter is not at least twice as big as in case of the former. For example, if the name of a service can be 100 character long, then it is quite illogical that the description of the service is only at most 200 characters long.Problem detectionINFORMATION_SCHEMA only2021-03-27 18:51MIT License
574Storing file content in the databaseFind columns that probably store content of files in the database.GeneralINFORMATION_SCHEMA only2021-03-27 17:02MIT License
575Do not assume you must use filesFind cases where you store images and other media as files outside the database and store in the database only paths to the files.Problem detectionINFORMATION_SCHEMA only2021-03-27 16:55MIT License
576Inconsistency between the name and the type of a base table column (dates)Find base table columns that name refers to the possibility that these are used to register dates. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column data type is "date", then the suffix of the column name should be "kp" (Estonian) or "date" (English).Problem detectionINFORMATION_SCHEMA only2021-03-27 16:16MIT License
577Columns of base tables with data about postal addresses, file addresses, or web addresses that have an incorrect data typeFind base table columns that name refers to the possibility that these are used to register file/web addresses. Find the columns where the type refers to the possibility that values in the column are actual files.Problem detectionINFORMATION_SCHEMA only2021-03-27 13:46MIT License
578Perhaps a too simplified state machineFind base table columns with Boolean type that name refers to the possibility that these are used to register as to whether an entity is currently in active state or not. Find the base tables that have exactly one Boolean column. During the system design one should find all the possible states of an entity type that influence the behavior of the information system. Data as to whether an entity is in one of these states should be in the database. Having only two states - active/inactive - is sometimes a too big simplification.Problem detectionINFORMATION_SCHEMA only2021-03-27 03:08MIT License
579Perhaps a state machine is implemented with timestamp columnsFind implementations of state machines that uses a set of columns with a timestamp type.Problem detectionINFORMATION_SCHEMA only2021-03-26 21:04MIT License
580Different character maximum lengths that are used to define textual base table columnsFind 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 measureINFORMATION_SCHEMA only2021-03-26 11:24MIT License