Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 584 Bytes

debugging.md

File metadata and controls

25 lines (21 loc) · 584 Bytes

When you are new to a project

Find columns of a specific table.

SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'public'
   AND table_name   = 'products';

Find specific columns

SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'public' AND 
 	column_name LIKE '%flow%';

Find size of tables

select table_schema, table_name, pg_size_pretty(pg_relation_size('"'||table_schema||'"."'||table_name||'"'))
from information_schema.tables
order by pg_relation_size('"'||table_schema||'"."'||table_name||'"') desc