{"id":537,"date":"2010-02-06T10:28:10","date_gmt":"2010-02-06T01:28:10","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=537"},"modified":"2025-03-12T11:31:55","modified_gmt":"2025-03-12T02:31:55","slug":"postgresql%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2010\/02\/06\/postgresql%e3%83%a1%e3%83%a2\/","title":{"rendered":"PostgreSQL\u30e1\u30e2"},"content":{"rendered":"<p>\u591a\u5206\u4f7f\u308f\u306a\u3044\u30e1\u30e2\u3002<\/p>\n<p>\u30fb\u30ab\u30e9\u30e0\u540dcolumn_name\u306e\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u63a2\u3059\u3002<br \/>\n\u00a0select t.relname,c.attname,format_type(c.atttypid, c.atttypmod) from pg_attribute as c<br \/>\n\u00a0inner join pg_stat_user_tables as t on(c.attrelid = t.relid)<br \/>\n\u00a0where attname = &#039;column_name&#039;;<\/p>\n<p>\u30fb\u30c6\u30fc\u30d6\u30eb\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3059\u308b\uff08\u30d6\u30ed\u30c3\u30af\u30b5\u30a4\u30ba*\u30d6\u30ed\u30c3\u30af\u6570\uff09\u3002<br \/>\n\u00a0SELECT tablename,pg_relation_size(tablename::text) from pg_tables where tableowner != &#039;postgres&#039;;<\/p>\n<p>\u00a0SELECT indexname,pg_relation_size(indexname::text) as indexsize from pg_indexes where schemaname != &#039;pg_catalog&#039;;<\/p>\n<p>\u30fb\u4eca\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u8abf\u3079\u308b\u3002<br \/>\n\u00a0SELECT\u00a0relname from pg_stat_all_tables where relid in(select relation from pg_locks) and schemaname != &#039;pg_catalog&#039;;<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537&#038;t=PostgreSQL%E3%83%A1%E3%83%A2&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=PostgreSQL%E3%83%A1%E3%83%A2\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537&#038;text=PostgreSQL%E3%83%A1%E3%83%A2\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537&#038;title=PostgreSQL%E3%83%A1%E3%83%A2\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=PostgreSQL%E3%83%A1%E3%83%A2&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=PostgreSQL%E3%83%A1%E3%83%A2&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F537\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u591a\u5206\u4f7f\u308f\u306a\u3044\u30e1\u30e2\u3002 \u30fb\u30ab\u30e9\u30e0\u540dcolumn_name\u306e\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u63a2\u3059\u3002 \u00a0select t.relname,c.attname,format_type(c.atttypid, c.atttypmod) from pg [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[135],"class_list":["post-537","post","type-post","status-publish","format-standard","hentry","category-1","tag-postgresql"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":8,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"predecessor-version":[{"id":4765,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/537\/revisions\/4765"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}