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...
181Perhaps checking of file extension is incorrectFind check constraints of tables that use a regular expression to check as to whether a registered string ends with an appropriate file extension. However, the expression does not put the dot sign into the square brackets nor does have the escape character \before it, i.e., it is interpreted as a single character not as the dot sign in the expression. In regular expressions the dot (.) matches any single character except the newline character.Problem detectionINFORMATION_SCHEMA only2023-11-08 15:29MIT License
182Column names that make joining tables more difficultFind foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
183Column names that make joining tables more difficult (quite similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is between two and four characters. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
184Column names that make joining tables more difficult (very similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is one character. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
185Perhaps the type of a base table column should be an integer type (based on column names)Find columns of base tables where the name of the column has prefix or suffix "id" or has the name "id" but the column does not have an integer type or uuid type. A convention is to use the phrase "id" in the names of surrogate key columns.Problem detectionINFORMATION_SCHEMA only2023-11-08 13:31MIT License
186Textual columns that have a secondary index but the operator class for the column does not support pattern matchingFind indexed textual columns where the indexing does not consider the possibility of pattern-based search. Such columns do not have an index where the used operator class makes the index suitable for use by queries involving pattern matching expressions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 11:52MIT License
187Tsvector values are not automatically calculatedFind base table columns with tsvector type in case of which it is not a generated column nor does the table has an associated trigger to calculate the tsvector value automatically.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 11:45MIT License
188Inconsistent means to calculate tsvector valuesFind as to whether in the database there are multiple ways to calculate tsvector values, i.e., by using a generated column and by not using a generated column.Problem detectionINFORMATION_SCHEMA only2023-11-07 11:35MIT License
189Multiple triggers that update tsvector valuesFind base tables that have multiple triggers to update tsvector values.Problem detectionsystem catalog base tables only2023-11-07 10:14MIT License
190Triggers that are used to calculate tsvector values react to a wrong set of eventsFind triggers on base tables that are used to calculate tsvector values that react to a wrong set of events, i.e., react to the DELETE event or do not react to the INSERT and UPDATE events.Problem detectionsystem catalog base tables only2023-11-07 10:14MIT License
191Names of database objects that are fully uppercaseFull uppercase means screaming and it makes comprehending the names more difficult. Find the names (identifiers) of user-defined database objects that are fully uppercase. Because PostgreSQL stores regular identifiers lowercase in the system catalog it also means that these are delimited identifiers, i.e., these are case sensitive.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:28MIT License
192Full text search columns that have no gin or gist indexFind columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index. These are the preferred index types for text search.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
193Full text search columns with other type of index than gin or gist indexFind columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index but have another type of index (e.g., b-tree). Gin and Gist are the preferred index types for text search.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
194Exclude constraint to prevent overlapping time periodsFind exclude constraints on base tables with multiple date/timestamp columns that prevent overlapping time periods.GeneralINFORMATION_SCHEMA+system catalog base tables2023-11-07 00:44MIT License
195Base 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
196Stating 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
197Inconsistent time zone and precision usage in case of registering timesFind as to whether different data types (with and without timezone) and precisions are used in case of registering times in different columns.Problem detectionINFORMATION_SCHEMA only2023-11-04 12:30MIT License
198Inconsistent time zone and precision usage in case of registering timestampsFind as to whether different data types (with and without timezone) and precisions are used in case of registering timestamps in different columns.Problem detectionINFORMATION_SCHEMA only2023-11-04 12:28MIT License
199Subqueries of derived tables with LIMIT/FETCH/DISTINCT ON without ORDER BYFind subqueries of derived tables (views, materialized views) with the LIMIT/FETCH clause or with DISTINCT ON construct but without the ORDER BY clause. These constructs require sorting to produce a meaningful result.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-03 16:56MIT License
200Precision of a timestamp or a time column is too bigFind columns with a timestamp or a time type where the precision (the permitted maximum number of fractional sections) is bigger than the precision in the default value of the column.Problem detectionINFORMATION_SCHEMA only2023-11-02 17:29MIT License