In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "what commands are commonly used in Postgresql". In the operation of practical cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
-- setting mode set search_path to firsoul;-- lists only tables in the current mode by default\ dMury-list common modes\ dn-- list all modes\ dnS-- view table size select pg_size_pretty (pg_relation_size ('test')) -- or\ dt+ test--infoSELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN' v 'THEN' view' WHEN'm' THEN 'materialized view' WHEN' THEN 'index' WHEN' S' THEN 'sequence' WHEN' s' THEN 'special' WHEN' f 'THEN' foreign table' WHEN 'p'THEN' table' END as "Type", pg_catalog.pg_get_userbyid (c.relowner) as "Owner" Pg_catalog.pg_size_pretty (pg_catalog.pg_table_size (c.oid)) as "Size", pg_catalog.obj_description (c.oid, 'pg_class') as "Description" FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespaceWHERE c.relkind IN '') AND n.nspname! ~'^ pg_toast' AND c.relname OPERATOR (pg_catalog.~)'^ (test) $'AND pg_catalog.pg_table_is_visible (c.oid) ORDER BY 1 spar2 -View schema size, table, index select schemaname, round (sum (pg_total_relation_size (schemaname | |'. | | tablename)) / 1024 from pg_tables where schemaname='public' group by 1024) "Size_MB" from pg_tables where schemaname='public' group by 1 select schemaname, round (sum (pg_total_relation_size (schemaname | |'. | | tablename)) / 1024 lap 1024) "Size_MB" from pg_tables where schemaname='public' group by 1 Select schemaname, round (sum (pg_total_relation_size (schemaname | |'. | indexname) "Size_MB" from pg_indexes where schemaname='public' group by 1-query database size select datname,pg_size_pretty (pg_database_size (datname)) from pg_database; "what are the common commands for Postgresql" here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.