Filter Queries

Found 1056 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets, it shouldn't be a problem in case of the relatively small amount of data in the system catalog of a database.

#641. Names of database objects that end with an underscore

INFORMATION_SCHEMA+system catalog base tables

Find names of database objects that end with a underscore.

Problem detection License: MIT (opens in new tab)

#642. Names of database objects that mix snake_case and camelCase/PascalCase

INFORMATION_SCHEMA+system catalog base tables

Use 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 detection License: MIT (opens in new tab)

#643. Names of database objects that start with an underscore

INFORMATION_SCHEMA+system catalog base tables

Improve the readability of names. Find the names (identifiers) of user-defined database objects that start with an underscore. This is not necessarily a mistake. For instance, parameter names could start with an underscore. On the other hand, it could be that the prefix is missing in the name.

General License: MIT (opens in new tab)

#644. Names of database objects with four or more consecutive identical symbols

INFORMATION_SCHEMA+system catalog base tables

Find names of database objects with four or more consecutive identical symbols

Problem detection License: MIT (opens in new tab)

#645. Names of database objects with perhaps too many digits

INFORMATION_SCHEMA+system catalog base tables

Find the names of database objects where more than half the signs are digits.

Problem detection License: MIT (opens in new tab)

#646. Names of database objects with perhaps too many subcomponents (terms)

INFORMATION_SCHEMA+system catalog base tables

"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 detection License: MIT (opens in new tab)

#647. Names of database objects with perhaps too many subcomponents (terms) that consist of only consonants

INFORMATION_SCHEMA+system catalog base tables

Find names of database objects where the number of subcomponents (terms) that consist of only consonants is bigger than the number of subcomponents that contain at least one vowel.

Problem detection License: MIT (opens in new tab)

#648. Names of indexes that do not contain the table name

system catalog base tables only

Find indexes that do not support a declarative constraint and that are perhaps badly named. Table names make the names more expressive and user-friendly.

Problem detection License: MIT (opens in new tab)

#649. Names of the columns of derived tables that have been given by the system

INFORMATION_SCHEMA+system catalog base tables

Find columns of derived tables that name has been given by the system. The creators of the table should specify the name themselves to avoid ugly names and nasty surprises.

Problem detection License: MIT (opens in new tab)

#650. Names of the password columns

INFORMATION_SCHEMA+system catalog base tables

Find names of columns of base tables, views, and materialized views that contain passwords. Make sure that the naming is consistent,

General License: MIT (opens in new tab)

#651. Names of triggers and rules that do contain the table name

INFORMATION_SCHEMA+system catalog base tables

The names should contain table name in order to make the names better understandable.

General License: MIT (opens in new tab)

#652. Names of triggers and rules that do not contain the table name

INFORMATION_SCHEMA+system catalog base tables

The names should contain table name in order to make the names better understandable.

Problem detection License: MIT (opens in new tab)

#653. Name starts or ends with spaces

INFORMATION_SCHEMA+system catalog base tables

Find the names of user-defined database objects (must be delimited identifiers) that start or end with spaces.

Problem detection License: MIT (opens in new tab)

#654. Naming of declarative base table constraints

INFORMATION_SCHEMA+system catalog base tables

Find the names of declarative base table constraints. Naming of constraints must be consistent. For instance, do not mix system-defined and user-defined names.

General License: MIT (opens in new tab)

#655. Naming of tables

INFORMATION_SCHEMA+system catalog base tables

Find the names of different types (base table, foreign table, view, materialized view) of tables. Naming of tables must be consistent. For instance, do not mix names in plural and singular form within the same table type.

General License: MIT (opens in new tab)

#656. No need to use to_date or to_timestamp function

INFORMATION_SCHEMA+system catalog base tables

Find expressions where a date literal with the ISO format is converted to date/timestamp by using to_date or to_timestamp function.

Problem detection License: MIT (opens in new tab)

#657. Non-foreign key columns that have no associated CHECK constraints

INFORMATION_SCHEMA only

Find what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing.

Problem detection License: MIT (opens in new tab)

#658. Non-foreign key indexes that have been named as foreign key indexes

INFORMATION_SCHEMA+system catalog base tables

Find indexes that are not on a foreign key column but the name of the index contains ixfk or idxfk.

Problem detection License: MIT (opens in new tab)

#659. Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not

INFORMATION_SCHEMA+system catalog base tables

Find non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent.

Problem detection License: MIT (opens in new tab)

#660. Non-predefined character classes must not be between double square brackets

INFORMATION_SCHEMA+system catalog base tables

Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(activate to sort ascending) Data source(activate to sort ascending) Last update(sorted descending, activate to sort ascending) License Actions
641 Names of database objects that end with an underscore Find names of database objects that end with a underscore. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
642 Names of database objects that mix snake_case and camelCase/PascalCase Use 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 detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
643 Names of database objects that start with an underscore Improve the readability of names. Find the names (identifiers) of user-defined database objects that start with an underscore. This is not necessarily a mistake. For instance, parameter names could start with an underscore. On the other hand, it could be that the prefix is missing in the name. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
644 Names of database objects with four or more consecutive identical symbols Find names of database objects with four or more consecutive identical symbols Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
645 Names of database objects with perhaps too many digits Find the names of database objects where more than half the signs are digits. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
646 Names 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 detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
647 Names of database objects with perhaps too many subcomponents (terms) that consist of only consonants Find names of database objects where the number of subcomponents (terms) that consist of only consonants is bigger than the number of subcomponents that contain at least one vowel. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
648 Names of indexes that do not contain the table name Find indexes that do not support a declarative constraint and that are perhaps badly named. Table names make the names more expressive and user-friendly. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
649 Names of the columns of derived tables that have been given by the system Find columns of derived tables that name has been given by the system. The creators of the table should specify the name themselves to avoid ugly names and nasty surprises. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
650 Names of the password columns Find names of columns of base tables, views, and materialized views that contain passwords. Make sure that the naming is consistent, General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
651 Names of triggers and rules that do contain the table name The names should contain table name in order to make the names better understandable. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
652 Names of triggers and rules that do not contain the table name The names should contain table name in order to make the names better understandable. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
653 Name starts or ends with spaces Find the names of user-defined database objects (must be delimited identifiers) that start or end with spaces. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
654 Naming of declarative base table constraints Find the names of declarative base table constraints. Naming of constraints must be consistent. For instance, do not mix system-defined and user-defined names. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
655 Naming of tables Find the names of different types (base table, foreign table, view, materialized view) of tables. Naming of tables must be consistent. For instance, do not mix names in plural and singular form within the same table type. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
656 No need to use to_date or to_timestamp function Find expressions where a date literal with the ISO format is converted to date/timestamp by using to_date or to_timestamp function. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
657 Non-foreign key columns that have no associated CHECK constraints Find what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
658 Non-foreign key indexes that have been named as foreign key indexes Find indexes that are not on a foreign key column but the name of the index contains ixfk or idxfk. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
659 Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not Find non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
660 Non-predefined character classes must not be between double square brackets Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)