gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
command to find size of postgresql object by oid? and command to find oid of object like…
- User
command to find size of postgresql object by oid? and command to find oid of object like database or table named Test
- Assistant
To find the size of a PostgreSQL object by its
oid, you can use thepg_size_pretty()function along with thepg_total_relation_size()function. Here's the command:SELECT pg_size_pretty(pg_total_relation_size('your_object_oid'));Replace
'your_object_oid'with the actualoidvalue of the object you want to check.To find the
oidof an object like a database or a table named "Test", you can use the following commands:For a database:
SELECT oid FROM pg_database WHERE datname = 'Test';For a table:
SELECT oid FROM pg_class WHERE relname = 'Test';Replace
'Test'with the actual name of the object you want to find theoidfor.