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...
161Registration/modification time is not mandatoryFind columns that contain registration or modification time but are optional.Problem detectionINFORMATION_SCHEMA only2023-11-26 16:51MIT License
162Should the time zone be recorded in case of time or not?Find all the base table columns that have the type time without time zone or time with time zone. Return the data only if there is at least one column with the type time without time zone and one column with the type time with time zone.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
163Should the time zone be recorded in case of timestamp or not?Find all the base table columns that have the type timestamp without time zone or timestamp with time zone. Return the data only if there is at least one column with the type timestamp without time zone and one column with the type timestamp with time zone.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
164Stating the obvious (column names)Find the names of columns where the name of the column contains a part of the name of the data type of the column. For instance, the query finds columns, were the name contains fragments integer_ or _integer.Problem detectionINFORMATION_SCHEMA only2023-11-04 15:19MIT License
165Storing file content in the databaseFind columns that probably store content of files in the database.GeneralINFORMATION_SCHEMA only2021-03-27 17:02MIT License
166System-generated domain CHECK constraint namesFind the names of domain CHECK constraints that have been system-generated. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Problem detectionINFORMATION_SCHEMA only2022-10-27 15:44MIT License
167Table check constraints with regular expressionsFind all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column and use a regular expression. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).GeneralINFORMATION_SCHEMA only2022-12-13 12:47MIT License
168Table columns that are associated with a sequence generatorSurrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there is no usage of 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.GeneralINFORMATION_SCHEMA only2021-03-07 21:06MIT License
169Table columns with NOT VALID CHECK constraintsFind CHECK constraints of base table and foreign table columns that are not valid. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
170Table privilegesCheck as to whether there are no unnecessary privileges.GeneralINFORMATION_SCHEMA only2020-12-29 10:38MIT License
171Table privileges have been granted to PUBLICYou should follow the principle of least privilege and thus not have in your database tables that usage privileges are granted to the pseudo-role PUBLIC, i.e., to all the database users now and in the future.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
172The expression of a check constraint that is associated with a domain needs type conversionFind check constraints of domains where the Boolean expression invokes an operation that does not match with the data type of the domain.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
173The maximum number of characters may be missingPerhaps the character maximum length has been omitted accidentally, i.e., one wrote VARCHAR instead of VARCHAR(n) where n is the maximum permitted number of characters in the field value. VARCHAR and TEXT are synonyms.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
174The number and percentage of base tables where all the non-primary key columns are optionalFind the number and percentage of base tables where all the non-primary key columns are optionalSofware measureINFORMATION_SCHEMA only2020-11-08 19:57MIT License
175The number and percentage of base tables without CHECK constraintsFind the extent in which data integrity is checked at the database level. Find the number and percentage of base tables that do not have any associated CHECK constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:15MIT License
176The number and percentage of base tables without keysFind the extent in which repeating rows are permitted in the database. Find the number and percentage (from the total number of base tables) of base tables that do not have the PRIMARY KEY constraint and also do not have any UNIQUE constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:16MIT License
177The number and percentage of optinal columns in base tablesFind the number and percentage of optinal columns in base tablesSofware measureINFORMATION_SCHEMA only2020-11-08 21:17MIT License
178The number of base table columns based on data typeFind the number of base table columns based on data type.Sofware measureINFORMATION_SCHEMA only2020-11-19 15:30MIT License
179The number of base table columns by type categoryFind the number of base table columns based on the category of data type that the columns have.Sofware measureINFORMATION_SCHEMA only2021-03-20 12:27MIT License
180The number of default valuesFind the total number of columns with a default value as well as the number of columns with different kinds of default values (the number of columns where the default is used to implement surrogate key, the number of columns where the default is not used to implement surrogate key, the number of columns with a static default value, the number of columns with a dynamic default value).Sofware measureINFORMATION_SCHEMA only2021-11-22 13:26MIT License