Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a0ff7f1

Browse files
authored
Update TODO.md
1 parent 340405d commit a0ff7f1

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎TODO.md‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,4 +878,26 @@ order by s.calls_total desc,
878878
n.nspname,
879879
c.relname
880880
limit 100;
881-
```
881+
```
882+
883+
# Как получить список всех временных таблиц текущей базы данных и их размер?
884+
885+
```sql
886+
SELECT
887+
n.nspname as SchemaName,
888+
c.relname as RelationName,
889+
CASE c.relkind
890+
WHEN 'r' THEN 'table'
891+
WHEN 'v' THEN 'view'
892+
WHEN 'i' THEN 'index'
893+
WHEN 'S' THEN 'sequence'
894+
WHEN 's' THEN 'special'
895+
END as RelationType,
896+
pg_catalog.pg_get_userbyid(c.relowner) as RelationOwner,
897+
pg_size_pretty(pg_relation_size(n.nspname ||'.'|| c.relname)) as RelationSize
898+
FROM pg_catalog.pg_class c
899+
LEFT JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
900+
WHERE c.relkind IN ('r','s')
901+
AND (n.nspname !~ '^pg_toast' and nspname like 'pg_temp%')
902+
ORDER BY pg_relation_size(n.nspname ||'.'|| c.relname) DESC;
903+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /