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...
841Using AFTER triggers to enforce constraintsDo not let the system to do extra work. Checking a constraint with an AFTER trigger means that the trigger procedure will be executed after the data modification and if the check fails, then the system has to do extra work to roll back the changes.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
842Using BEFORE triggers to log data changesDo not let the system to do extra work. Logging changes with a BEFORE trigger means extra work for rolling back the changes in case the logged data modification fails.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
843Name and description maximum lengthFind tables where is both a column for registering name and description. Find the permitted maximum field size in these columns. Take into account that the maximum length may be controlled by using a CHECK constraint. Make sure that the permitted maximum field sizes are sufficiently different.GeneralINFORMATION_SCHEMA+system catalog base tables2021-02-24 20:36MIT License
844Base tables with multiple Boolean columnsFind base tables that have more than one column with Boolean type.GeneralINFORMATION_SCHEMA only2021-02-19 17:41MIT License
845Base tables with multiple temporal columnsFind base tables that have more than one column with a temporal type (date or timestamp).GeneralINFORMATION_SCHEMA only2021-02-19 17:37MIT License
846All domain default valuesFind domains that specify a default values and columns that are defined based on the domain. Make sure that there are no unsuitable default values.GeneralINFORMATION_SCHEMA only2021-01-19 13:04MIT License
847All user triggers that are associated with tablesFind user-defined triggers that react to data modifications in tables. Triggers should be used only for the tasks that cannot be achieved in a declarative manner, i.e., by declaring a constraint. Triggers of the same table with the same event_manipulation, action_timing, and action_orientation are sorted based on the trigger name. This is the order of execution of triggers.GeneralINFORMATION_SCHEMA+system catalog base tables2021-01-19 11:27MIT License
848The proportion of mandatory and optional textual base table columnsFind the number of textual base table columns, the number of optional textual base table columns (permit NULLs), and the number of mandatory textual base table columns (do not permit NULLs).Sofware measureINFORMATION_SCHEMA only2021-01-15 17:39MIT License
849Columns defined in a subtableFind columns that have been added to a subtable, i.e., these were not defined in its immediate supertable.GeneralINFORMATION_SCHEMA+system catalog base tables2021-01-02 03:22MIT License
850Privileges to execute routinesFind privileges to execute routines that have been given to non-superusers. Check as to whether it conforms to the principle of least privilege. Check that users that correspond to applications have all the necessary privileges. Users (applications) should use a database through virtual data layer. Thus, if they need to modify data in the database (in case of table functions read data), then they must execute a routine.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-29 10:38MIT License
851Privileges to use base table columnsIf you do give privileges to base tables, then these should follow the principle of least privilege - the smallest possible amount of privileges to the smallest possible set of columnsGeneralINFORMATION_SCHEMA+system catalog base tables2020-12-29 10:38MIT License
852Privileges to use base tablesUsers (applications) should ideally use a database through virtual data layer and thus not directly use base tables. If there is a need to provide direct access to the base tables, then one should grant access based on the principle of least privilege, i.e., to the minimum possible number of base tables.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-29 10:38MIT License
853Privileges to use viewsFind privileges to use views. Check as to whether it conforms to the principle of least privilege. Check that users that correspond to applications have all the necessary privileges. Users (applications) should use a database through virtual data layer. Thus, if they need to read data from a database, then they should use views.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-29 10:38MIT License
854Table privilegesCheck as to whether there are no unnecessary privileges.GeneralINFORMATION_SCHEMA only2020-12-29 10:38MIT License
855Consistency of using NOT NULL constraints on Boolean base table columnsFind the number of mandatory and optional Boolean base table columns and the proportion of optional columns from all the Boolean columns. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the Boolean columns mandatory.Sofware measureINFORMATION_SCHEMA only2020-12-28 01:43MIT License
856Not inherited CHECK constraintsFind CHECK constraints that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. CHECK(false) on a supertable is an appropriate CHECK constraint if one wants to prevent registering data directly to the supertable, i.e., data can only be added to the subtables.Generalsystem catalog base tables only2020-12-27 17:42MIT License
857CHECK constraints on columns with Boolean dataFind check constraints that involve columns with the type Boolean.GeneralINFORMATION_SCHEMA only2020-12-27 15:09MIT License
858Constraints that are not redefined in a subtable but there is a CHECK constraint that compensates thisFind primary key, unique, foreign key, and exclude constraints that have been defined in a supertable (parent table) but not in its subtable. Exclude constraints where in case of the subtable there is a CHECK that permits only one specific value in the constraint column. The presence of such check would make the design acceptable. Unfortunately, PostgreSQL table inheritance is implemented in a manner that some constraints (CHECK, NOT NULL) are inherited from the supertable but others are not. "All check constraints and not-null constraints on a parent table are automatically inherited by its children, unless explicitly specified otherwise with NO INHERIT clauses. Other types of constraints (unique, primary key, and foreign key constraints) are not inherited." (PostgreSQL documentation)GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-25 16:20MIT License
859The same trigger function is used in case of multiple tablesFind trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences.GeneralINFORMATION_SCHEMA only2020-12-25 14:50MIT License
860All event triggersFind event triggers, which are not associated to a specific schema object.Generalsystem catalog base tables only2020-12-24 14:54MIT License