Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/data/web/virtuals/98151/virtual) in /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/wp-simple-firewall/src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php on line 465

Warning: Cannot modify header information - headers already sent by (output started at /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/wp-simple-firewall/src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php:465) in /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/disable-xml-rpc-pingback/disable-xml-rpc-pingback.php on line 51
pg_catalog Archives - PostgreSQL Candies

Check real sizes of columns in tables

Do you need to know which columns takes most disk space in your tables? Here is one useful statement: with srcdata as ( select table_schema||'.'||table_name as _table, column_name as _column, count(column_name) over (partition by table_schema, table_name) as...

Drop all versions of a function

Do you need to drop all existing versions of some function without knowing anything about parameters? Try this: do $$ declare _rec record; begin for _rec in select 'drop function if exists '||ns.nspname||'.'||p.proname||'('||pg_catalog.<tt...

Locks on objects with relationships

(added version for PG 9.6+) If you want to check for specific object – specify it in WHERE clause. Explanations for the content of the result: connection which locks is selected at the top, connections which waits for lock a bellow every connection has also its...

Simple query to find object in all databases on your server

This is also only very small hint. As you probably already very well know databases on PostgreSQL server are isolated and you cannot so easily run queries across them. This small query shows one simple way how to check for some pattern in table and view names across...