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...
781All 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
782All user-defined TOAST-able typesFind user-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).Generalsystem catalog base tables only2020-11-06 14:51MIT License
783User-defined derived tablesFind user-defined views and materialized views. Pay attention to the outer join operations. One should use these if and only if there is a real need for them. Otherwise they just reduce performance. On the other hand, pay attention that outer join is used where it is logically needed.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-11 15:23MIT License
784User-defined routines that implement UPSERT operationFind user-defioned routines that implement UPSERT operation. Make sure that it is consistent with the contracts of database operations.GeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 17:02MIT License
785User-defined routines that produce a temporary tableFind user user-defined routines that produce a temporary tableGeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:25MIT License
786Derived tables that present data in json or xml formatFind views and materialized views that present data in json or xml format. Instead of recording data in this format in base tables one could generate the data value on the fly based on data that has been recorded in base tables.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
787Derived tables with rankingFind views and materialized views that use rank and dense_rank window functions.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
788Derived tables with string_aggFind views and materialized views that use string_agg aggregate function.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
789Too short or missing comments of derived tables and routinesFind views, materialized views, and user-defined routines that do not have a comment at all or the comment is shorter than twice the length of the object name, or the comment states that it is missing (TODO). You should give information to future developers and maintainers of the system (including the future version of yourself). Do not just repeat the name in the comment (with perhaps some rewording).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-19 12:56MIT License
790Updatable views that have not been turned to read onlyFind views that are theoretically updatable but do not have INSTEAD OF trigger or DO INSTEAD NOTHING rule to prevent data modifications through the view.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 10:20MIT License
791Views without security barrierFind views that do not have the security barrier option.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-22 12:05MIT License
792Views with WHERE but without security barrierFind views that do not have the security barrier option but restrict rows in some way.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-14 12:58MIT License
793Views with security invokerFind views that have the security invoker option. Such option is possible starting from PostgreSQL 15. In case of using such views one cannot create a system where data is accessed through views and the users (applications) do not have direct access to the base tables.Problem detectionsystem catalog base tables only2023-11-13 12:20MIT License
794Derived table uses a function to get data from another tableFind views that use a function to get data from another table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 14:36MIT License
795Duplicate viewsFind views with exactly the same subquery. There should not be multiple views with exactly the same subquery. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
796Views with unnecessary security invokerFind views with security invoker option that do not have any underlying base table with a security policy. Security invoker option of views is possible starting from PostgreSQL 15. "The main use case (and the one that inspired the feature) is to be able to use views and still check row-level security policies on the underlying tables as the invoker."Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-17 18:39MIT License
797Non-foreign key columns that have no associated CHECK constraintsFind 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 detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
798The 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
799Do not always depend on one's parentFind where a hierarchical structure is implemented in a base table by adding a foreign key that refers to a candidate key of the same table.Generalsystem catalog base tables only2021-03-12 15:36MIT License
800Do not always depend on one's parent - column names are ot sufficiently differentFind where a hierarchical structure is implemented in a base table by adding a foreign key that refers to a candidate key of the same table. Find only cases where the candidate key and foreign key column names are very similar (Levenshtein distance shorter than four).Problem detectionsystem catalog base tables only2022-11-26 17:19MIT License