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...
281Perhaps a too long name, which has been automatically shortenedFind names (identifiers) of user-defined database objects that are 63 bytes long. This is the longest permitted length of identifiers if the default value of the NAMEDATALEN parameter has not been changed. PostgreSQL shortens too long identifiers automatically. Automatic code modification could break it somewhere.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:05MIT License
282Name starts or ends with spacesFind the names of user-defined database objects (must be delimited identifiers) that start or end with spaces.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:03MIT License
283Names of database objects with perhaps too many subcomponents (terms)"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) The number of subcomponents (terms) should not be too big. Find the names (identifiers) of user-defined database objects that perhaps contain too many subcomponents, assuming, that the separator of the components is "_".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:02MIT License
284Names of database objects that contain dollar signFind names of database objects that contain a dollar sign ($) that is not the first symbol of the name. In PostgreSQL regular identifiers cannot start with $. However, $ can be used in other positions of the name. "Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:00MIT License
285Names of database objects that end with an underscoreFind names of database objects that end with a underscore.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 09:56MIT License
286The same database object name is used repeatedly in case the same database object typeFind what database object names are used more than once in case the objects of the same type. If the names differ from each other only by digits or underscores, then consider these the same name. For instance, if there are base tables Person and Person2 (in the same schema or different schemas), then the query returns the name Person. Make sure that there is no duplication of implementation elements in the database.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:12MIT License
287Frequency of lengths of the names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find how many names (identifiers) of database objects there are with different lengths. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:10MIT License
288The longest names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the TOP 3 longest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:09MIT License
289Median and average of the length of names of database objects by the object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the median length and average (arithmetic mean) length of the names (identifiers) of user-defined database objects by the object type. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:08MIT License
290Meaningless terms in namesFind names of database objects that contain terms "foo", "bar", "foobar", or "baz".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:07MIT License
291Perhaps the name referes to multiple conceptsFind database objects that name contains words "and" (English) or "ja" (Estonian).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:42MIT License
292Names of database objects that mix snake_case and camelCase/PascalCaseUse consistent style of naming. Prefer snake_case. Regular identifiers are stored in the PostgreSQL system catalog in lowercase. Thus, if you use, for instance the identifier thisIsLongTableName, then, for instance,in the pg_dump result you will see the table name thisislongtablename. If the name in the system catalog is thisIsLongTableName, then it means that the name is a delimited identifier, i.e., case sensitive.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:34MIT License
293Duplicate commentsFind comments that have been registered with a COMMENT statement and that are associated with more than one object. It would probably mean that a comment is incorrect or missing.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:33MIT License
294The number and percentage of different names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects by the object type and compare it with the total number of database objects with this type. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-16 15:38MIT License
295Perhaps a too generic foreign key column nameFind the names of foreign key columns that are too generic. The expressive names of table columns allow database users better and more quickly understand the meaning of data in the database. A person could participate in a process or be associated with an object due to different reasons. Thus, foreign key column names like isik_id, person_id, tootaja_id, worker_id etc. are too generic. The name should refer (also) to the reason why the person is connected.Problem detectionsystem catalog base tables only2023-03-15 18:27MIT License
296Unnamed parametersFind unnamed parameters in PL/PGSQL routines that do not declare aliases for parameters and in SQL routines. Avoid unnamed parameters because dependency on position in case of referencing the parameters makes evolving the code more difficult. In case of unnamed parameters - if one changes the order of parameters in the routine signature, then one has to change the body of the routine in order to use correct references. The bigger is the number of parameters in a routine the more the unnamed parameters make it more difficult to understand the routine.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-15 18:16MIT License
297SQL function does not return a valueFind SQL functions that do not return a value (return VOID) but the SQL statement in the function has RETURNING clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-02-27 17:28MIT License
298Too generic names (parameters)Find the names of parameters that are too generic. The routines work with data/information. Thus, it is not a good style to use generic words like data, information, parameter, etc. In the names of parameters. Moreover, avoid too generic parameter names like: id, tyyp, kood, aeg, kp,type, code, time, date, fk, pk, param.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 14:08MIT License
299Parameter name is the same as the name of a used columnIf the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 13:54MIT License
300Parameter name is the same as the name of a used column (ver 2)If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 13:54MIT License