PostgreSQL Advent Calendar 2012ï¼å ¨é¨ä¿ºï¼ã®Day 1ã§ãã åæ¥ã¯ãã¾ãPostgreSQLã使ãå§ããéã®åºæ¬çãªãä½æ³ã§ããåæè¨å®ã«ã¤ãã¦ç°¡åã«ã¾ã¨ãã¦ã¿ã¾ãã PostgreSQLã¯ããã©ã¡ã¼ã¿ã®è¨å®ãå¤æ´ããã«ããã©ã«ãã®è¨å®ã®ã¾ã¾ä½¿ãå§ãã¦ãããã¡ããåããã¨ã¯åãã®ã§ãããå¾ããããããã¨åé¡ãåºã¦ãããã¨ãããã¾ãããç¹ã«æ§è½é¢é£ã®ãã©ã¡ã¼ã¿ã®ããã©ã«ãå¤ã¯ãã¾ãã«å°ããããã¥ã¼ãã³ã°äºã 以åã®åé¡ã ã£ãããã¾ãã ã¨ããããã§ãç§ãæ®æ®µPostgreSQLãã¤ã³ã¹ãã¼ã«ãã¦ä½¿ãå§ããæãéçºæ©ã§ãã£ã¦ãããã¤ããã©ã¡ã¼ã¿ãåæè¨å®ããããã«ãã¦ãã¾ãã 使ãå§ããåã«è¨å®ããå ¥ãã®ã¯ç¢ºãã«é¢åãªã®ã§ãããæåã«è¨å®ãå¿ è¦ãªãã©ã¡ã¼ã¿ã¯å°æ°ï¼ä»åç´¹ä»ããã®ã¯5ã¤ï¼ã§ãã®ã§ãã¾ãã¯æåã«å¿ è¦æä½éã®è¨å®ããã¦ãã使ãå§ãã¾ããããã¨ããã®ãæ¬ã¨
ããã¥ã¼ã ç¶æ³ããã©ã³ãç¨çµ±è¨æ å ±ã«ã¤ã㦠ãä¸è¦§ã«æ»ããââââââââââââââââââââââââââââââââââââââââ â â â â PostgreSQL ã¹ãã«ã¢ãããã¼ã â â â â â ââ â ããã¥ã¼ã ç¶æ³ããã©ã³ãç¨çµ±è¨æ å ±ã«ã¤ã㦠â â â â â â â â â â â â 2012/11/2 â â â â 使ç¨ç°å¢ï¼PostgreSQL9.1.4 (CentOS6.2) (C) 2012 ohdb ââââââââââââââââââââââââââââââââââââââââ â èªå·±é½åã«ããå®æ©ç¢ºèªã¯9.1ãããã¥ã¢ã«ã¸ã®ãªã³ã¯ã¯9.2ã¨ãã¦ãã¾ãã ã»ããã¥ã¢ã« ãµã¼ãã®è¨å®ã»èªåããã¥ã¼ã ä½æ¥ââ[ããã¥ã¢ã«] å®å¸¸ä¿å®ä½æ¥ã»èªåããã¥ã¼ã ãã¼ã¢ã³ââ[ããã¥ã¢ã«] ãã©ã³ãã§ä½¿ç¨ãããçµ±è¨æ å ± ââ[ããã¥ã¢ã«] pg_statistic(å®ä½ï¼ââ[ããã¥ã¢ã«] pg_
PostgreSQL Advent Calendar 2014 ã® 13æ¥ç®ã§ãã Advent Calendar ãä»å¹´ããã£ã¦ã¿ããã¨æã£ã¦ãæ ã空ãã¦ããã®ã§é£ã³è¾¼ãã§ã¿ã¾ããã æ¨æ¥ã¯ osapon ããã® libpqxx ã使ã£ã¦ã¿ãã§ããã æ¦è¦ PostgreSQL ã®ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ã¯å¤§ããä¸è¨ã«åããã¾ãã ã·ã¹ãã ãã¥ã¼ãã³ã° SQL ãã¥ã¼ãã³ã° ããã§ã¯ Linux ä¸ã§åããã¦ãããã¨ãåæã«ããããã説æãã¾ãã ã·ã¹ãã ãã¥ã¼ãã³ã° ã·ã¹ãã ãã¥ã¼ãã³ã°ã®æ¦è¦ ã·ã¹ãã ãã¥ã¼ãã³ã°ã¨ã¯ãOS ã¾ã㯠PostgreSQL ã®è¨å®ãå¤æ´ãããã¨ã§ãã ããããé ã«èª¬æãã¾ãã OS ãã¥ã¼ãã³ã° PostgreSQL ã§ã¯ç¹ã«ã¡ã¢ãªé¢é£ã§OSãã©ã¡ã¼ã¿ãè¨å®å¤æ´ããã¨ãé«éåå¹æãå¾ããã¾ãã ç¹ã«ä¸è¨ã®ã«ã¼ãã«ãã©ã¡ã¼ã¿ã«æ³¨æãã¾ãã vm.dirt
äºåæ å ± m3.xlargeã¤ã³ã¹ã¿ã³ã¹ 15GB ã¡ã¢ãª 13 ECU = 3.25ECU(2.6GHz) * ä»®æ³4ã³ã¢ DBãµã¤ãº 3.38 GB è¨å®å¤ max_connections = 100 shared_buffers = 3GB # å®ã¡ã¢ãªã®20% # ãããã¸ãã®ã¯ã¨ãããããã®ãããã§ãå°ããããåã«ã¯log_temp_filesã®è¨å®ã§æ¸ãåºãããã®ã§å¾ã§æ°ã¥ãã¦èª¿æ´ã§ããã temp_buffers = 32MB work_mem = 32MB maintenance_work_mem = 128MB wal_buffers = 16MB # è¿·ãã©ããããªã16MB checkpoint_segments = 16 # HDã¸ã®ãã©ãã·ã¥åæ°ãæ¸ãã effective_cache_size = 7GB # planerã®ãããå®ã¡ã¢ãªã®ååããããããããã
PostgreSQLã®è¨å® ãã¥ã¼ãã³ã°Â¶ PostgreSQL when it is not your job - Christophe Pettus çµç±ã§ DjangoCon Europe 2012 ã§çºè¡¨ããã ãã®ã¹ã©ã¤ã ãç¥ã£ãã®ã§ã ã¡ã¢ä»£ããã«æ®ãã¦ã¿ãã件ã®blogã¯æç²ãªã®ã§ãããã§ã¯å¯è½ãªéãå ¨é¨è¼ ãã¾ãã æåã«Â¶ æ°ãã¤ããè¨å®ã¯ããã ãã ãã° ã¡ã¢ãª ãã§ãã¯ãã¤ã³ã ãã©ã³ãã¼ ãã°Â¶ ãã°ã«å¯¾ãã¦å¯å®¹ã«ãªããã¨ãã·ã¹ãã ã¸ã®å½±é¿ã¯å°ãªãã ãã°ã¯æ§è½åé¡ã解決ããããã®ä¸çªããæ å ±ã ã©ãã«ãã°ãåºãï¼Â¶ syslog: ãã§ã«syslogã使ãã·ã¹ãã ãæ§ç¯ãã¦ããªããããããã§ããã æ¨æºå½¢å¼ã®ãã¡ã¤ã«: æ¨æºå½¢å¼ã®ãã¡ã¤ã«ã使ããã¼ã«ããã§ã«ä½¿ã£ã¦ããã°ããã ããã§ãªããã° CSVãã©ã¼ããã ãã¨ã®è¨å®ã¯ããã log_destination
postgresql.confã®è¨å®ã«ãããæ§è½åä¸ããæ¹æ³ãç´¹ä»ãã¾ãã以ä¸ãPostgerSQL Conference 2009 Japanã®çºè¡¨è³æ 'PostgreSQLã®ãã¥ã¼ãã³ã°ææ³' ãåèã«ãã¾ããã shared_buffers ãã£ã¹ã¯ããèªã¿è¾¼ãã ãã¼ã¿ããã£ãã·ã¥ããããã«ä½¿ç¨ããã¡ã¢ãªéãæå®ãã¾ãããã·ã³ã«æè¼ããã¦ããã¡ã¢ãªã® 20% ç¨åº¦ã«è¨å®ãã¾ãã Linuxã®å ´åãshared_bufferãå¢ããã¨ã«ã¼ãã«ã® shmmax ã®è¨å®å¤ãè¶ ããå ´åãããã¾ããshmmax (/proc/sys/kernel/shmmax)ã shared_buffer以ä¸ã«è¨å®ãã¦ãããªãã¨ãPostgreSQLã¯èµ·åãã¾ãããã¾ããshmallã®å¤ã¯ãshmmax/shmnmi (shmmaxãshmnmiã§å²ã£ãå¤)以ä¸ã«è¨å®ãã¦ããå¿ è¦ãããã¾ããé常ãshmn
ä½è Greg SmithãRobert Treatãããã³Christopher Browne PostgreSQLã¯æ§è½ãããå¹ åºãäºææ§ãç®çã«è¨å®ããããåºæ¬è¨å®ã§é å¸ããã¦ãã¾ãã ããã©ã«ãã®ãã©ã¡ã¼ã¿ã§ã¯ã使ç¨ä¸ã®ã·ã¹ãã ãéå°è©ä¾¡ãã¦ãã¾ãå¯è½æ§ãé«ãã§ãã æçµçã«ææ¡ããªããã°ãªããªãé ç®ã®ãã¹ã¦ï¼å¿ è¦ãªãã°GUC Three Hour Tourãåç §ãã¦ãã ããï¼ã«å¼ãããè¾¼ã¾ããªãããã«ãããã§åºæ¬ãç°¡åã«ç´¹ä»ãããã¨ã§ãå©ããããã¨æãã¾ãã ãããã¯PostgreSQLã®åå¿è ã¯æ°ã«ããªãããã£ã¨ãä¸è¬çãªãã®ã®ããã§ãã ããã§ç´¹ä»ããæ¦è¦ãèªãã å¾ã«ãã詳ããç¥ããããã°ãåç¯ã«ã¦ãã©ã¡ã¼ã¿ã®ååãã¯ãªãã¯ãã¦ãã ããã ææ°ã®PostgreSQLã®ããã¥ã¢ã«ã®é¢é£ææ¸ã«ãªã³ã¯ãã¦ãã¾ãã ããã«Server Configuration Tuningã«ã¯ãã
ãã¾ãã«ããã使ç¨ããã®ã§ããã³ãã¬ã¼ãåãã¦ã¿ãã DECLARE --#------------------------------------------------------------------- --# 使ç¨å¤æ°ã®å®ç¾© --#------------------------------------------------------------------- -- ã¢ã³ãã¦ã³ãã«ã¼ã½ã« cursor_mydata refcursor; -- ãã§ããããå 容ãæ ¼ç´ããçºã®ã¬ã³ã¼ã rec_nowdata record; BEGIN --#------------------------------------------------------------------- --# ã«ã¼ã½ã«ãªã¼ãã³ --#------------------------------------
ç¬ å è¾°ä» æ¬è¨äºã¯2013å¹´ã®PostgreSQL Advent Calendar ã® 12/25 ã®è¨äºã§ã(å°å³ãªãããã¯ã«ãªã£ã¦ãã¾ãããã¾ãã)ãPostgreSQLã§ã®ãã¹ããã¼ã¿ä½æã«å½¹ç«ã¤æ©è½ãç´¹ä»ãã¾ãã ã¯ããã« PostgreSQLã対象ã¨ããã®æ§è½æ¤è¨¼ãæ©è½æ¤è¨¼ãè¡ãéã«ãéçºç°å¢ã試é¨ç°å¢ã§ã¹ãã¼ã(ãã¼ãã«ãã¤ã³ããã¯ã¹)ãä½æããããã¼ã®ãã¼ã¿ãæå ¥ãã¦SQLã®ãã§ãã¯ãè¡ããã¨ãå¤ã ãããã¨æãã¾ããåç´ãªæ©è½ã®æ£å¸¸è©¦é¨ã§ããã°å°éã®ãã¼ã¿æå ¥ã§äºè¶³ããã¨æãã¾ããã大éã®ãã¼ã¿ã«å¯¾ããæ¤ç´¢å¦çããããå¦çã試ãéã¯ããããªãã®éã®è©¦é¨ãã¼ã¿ãçæããDBã«æå ¥ããå¿ è¦ãããã¾ãã é常ã試é¨ãã¼ã¿ã¯ãä¾ãã°å°ç¨ã®ã¸ã§ãã¬ã¼ã¿ãä½ããå®éã®ãã¼ã¿ããã¹ãã³ã°ãããã®ã使ãããµã³ãã«ã¨ãã¦åå¨ãããã¼ã¿(éµä¾¿çªå·ã®ãã¼ã¿ãªã©)ãå©ç¨ãããã¨ãã£ããã¨ãå¤ãã¨æ
Web-based PostgreSQL Development All you need is a modern web browser, from there you can simplify your PostgreSQL Development, run SQL queries, and manage your database. Continue Reading Open Source Web Interface for PostgreSQL PostgreSQL Studio makes it possible to edit your database code, navigate your schema and run full SQL queries from web pages that live in a browser. It is a database devel
OSSã®RDBMSã§ããPostgreSQLã§ãäºåããã¦ããã»ãã¥ãªãã£ã¢ãããã¼ãããªãªã¼ã¹ããããã¦ã¼ã¶ã¼ã¯éãããªã¢ãããã¼ããã 2013å¹´4æ4æ¥ãPostgreSQLã§ãæ·±å»ãªèå¼±æ§ãã«å¯¾å¿ããããã®ãã¤ãã¼ã¢ãããã¼ãããªãªã¼ã¹ãããã ä»åçºè¦ãããèå¼±æ§ã¯ãDBã®æ£è¦ã¢ã«ã¦ã³ããæããªãã¦ã¼ã¶ã¼ãpsqlãªã©ã§DBæ¥ç¶ãããã¨ããã ãã§DBãç ´å£ã§ããã¨ãããã®ãã-ãã§å§ã¾ãã¦ã¼ã¶ã¼åã§æ¥ç¶ããã¨ããã¼ã¿ãã¼ã¹ãµã¼ãã®ãã¼ã¿ãã£ã¬ã¯ããªæ§é ãªã©ã«å½±é¿ãä¸ããå¯è½æ§ããããä¸è¬ã¦ã¼ã¶ã¼æ¨©éã§å®è¡ã§ãããã¨ãããã¦ã¼ã¶ã¼ã«ã¯éãããªã¢ãããã¼ããå¼ã³æãã¦ããã ããå³æã®ã¢ãããã¼ããå°é£ãªå ´åã¯ãä¸æçã«ãªã¼ãã³ãªãããã¯ã¼ã¯ããPostgreSQLã¸ã®æ¥ç¶ãå¶éããã¨ãã£ãåé¿çãæ¤è¨ããå¿ è¦ãããã ããã ã¢ãããã¼ãã®å¯¾è±¡ã¯ä»¥ä¸ã®ãã¼ã¸ã§ã³ã7.4ç³»ã8.0ï½3
2013å¹´2æ16æ¥ã«éå¬ããããPostgreSQLã¢ã³ã«ã³ãã¡ã¬ã³ã¹ãã§ã®ã»ãã·ã§ã³ãâä»ããã«ããå±æ©âãæãã ï½ pg_stat_statements revisitedãã§ä½¿ã£ãã¹ã©ã¤ããå ¬éãã¾ããã SQLã®ããã©ã¼ãã³ã¹åæããã¥ã¼ãã³ã°ã«ä»ãä¸å¯æ¬ ãªpg_stat_statementsãã¥ã¼ã®ä½¿ãæ¹ãç°¡åã«è§£èª¬ããè³æã§ãã å½æ¥ãã»ãã·ã§ã³ã«åå ãã¦ããæ¹ã«èãã¦ã¿ããããpg_stat_statementsãç¥ããªãã£ããã¨ããç¥ã£ã¦ãããã©ä½¿ã£ããã¨ããªãã£ããã¨ããæ¹ãå¤ããã¾ããã®ã§ãæ¹ãã¦ãã²è¦ã¦ã¿ã¦ããã ããã°ã¨æãã¾ãã è³æã®ä¸ã§ä¾¿å©ã¹ã¯ãªãããç´¹ä»ãã¦ãã¾ãã®ã§ããã¡ããä½µãã¦ã©ããã â»é¢é£ã¨ã³ã㪠å®è¡ãé ãSQLæãpg_stat_statementsã§æ½åºãã
NTT ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ã»ã³ã¿ ç¬ å è¾°ä» PostgreSQL ã§ã®ããããã§ãããã°ã®è¨å®ããç¥ãããã¾ããããã§ãããã°ã¨ã¯ãPostgreSQL ã§çºçããã¨ã©ã¼ãè¦åãªã©ã®åé¡ãè¨é²ãããµã¼ããã°ãæãã¾ãããã°ã«é¢ããè¨å®ã¯ãPostgreSQLã®éç¨ãå§ããéã«æã注æãã¹ããã©ã¡ã¼ã¿è¨å®ã®ä¸ã¤ã§ãããã°ã¯åé¡çºçã®æç¡ãåé¡ã®åå ãåãåããéã«ãé常ã«éè¦ãªæ å ±ã¨ãªãã¾ããé©åãªãã°ã®éç¨ã«åãã¦ãä¸è¨ãåèã«ãã¦ã¿ã¦ãã ããã ãã°éç¨é¢é£ã®ãã©ã¡ã¼ã¿è¨å® PostgreSQLã®ããã©ã«ãè¨å®ï¼ã½ã¼ã¹ã³ã¼ãããã®ã¤ã³ã¹ãã¼ã«ï¼ã§ã¯ããã°ã¯æ®ããªãè¨å®ã«ãªã£ã¦ãã¾ããã¤ã³ã¹ãã¼ã«ã«ä½¿ã£ãããã±ã¼ã¸ã«ãã£ã¦ã¯ãåããããã°ãæ®ãããè¨å®ãã¡ã¤ã«ãã«ã¹ã¿ãã¤ãºããã¦ãããã¨ãããã¾ãããã¾ãã¯ã確å®ã«ãã°ãæ®ãããã®è¨å®ãè¡ãã¾ãããã ãã°ã®éç¨ã¨ãã¦ã¯å¤§ãã3ã
TOP > PostgreSQLã¨ã©ã¼ãpsql: could not connect to server: ãã¹ãã¸ã®çµè·¯ãããã¾ãããã®åå ã¨è§£æ±ºæ¹æ³ï¼iptablesã®è¨å®ï¼ PostgreSQLã¨ã©ã¼ãpsql: could not connect to server: ãã¹ãã¸ã®çµè·¯ãããã¾ãããã®åå ã¨è§£æ±ºæ¹æ³ï¼iptablesã®è¨å®ï¼ ITã»ã³ã³ãã¥ã¼ã¿ã»å®¶é»ç ãããµã¼ããããå¥ã®ãµã¼ãã®PostgreSQLãã¼ã¿ãã¼ã¹ã«psqlæ¥ç¶ã試ã¿ãæã«ãæ¥ç¶ã«å¤±æããå ´åãããã ãä¾ããµã¼ãAï¼nekoï¼192.168.2.3ï¼ãããµã¼ãBï¼nobunekoï¼192.168.2.4ï¼ã®PostgreSQLãã¼ã¿ãã¼ã¹ã«psqlæ¥ç¶ã試ã¿ãå ´å ï¼ï¼psql -U postgres -h 192.168.2.4ã§æ¥ç¶ã§ããªããã¨ãç¢ºèª [root@neko ~]# psql -U
PostgreSQL ã®ãã°è§£æãè¡ãã pgFouine ã試ãã¦ã¿ããä»ã¯ ver 1.2 ãåºã¦ããæ§åã PostgreSQL ã¯ä»¥åã¤ã³ã¹ãã¼ã«ãã ver 9.0.1 ã使ç¨ãã¦ã¿ãã対象ã¨ãã DB 㯠DWH ã§ä½¿ç¨ãã¦ãã DB ã®ãã°ãæåããã â PostgreSQL ã®ãã°è¨å® PostgreSQL ã®ãã°åºåè¨å®ãè¡ããç·¨é対象㯠${PGDATA}/postgresql.conf ãç·¨éããé ç®ã¯ä¸è¨ã®éãã log_destination = âsyslogâ silent_mode = off log_min_duration_statement = 0 log_duration = off log_statement = ânoneâ ããã辺ã®è¨å®å 容㯠pgFouine ã®ãã¥ã¼ããªã¢ã«ã«æ¸ãã¦ãã£ããã®ãåèã«ãã¦ããããã°åºåã¯å ¨ã¦ã® SQL ã
PostgreSQLã§ãã¼ãã«ãµã¤ãºãå¾ã¶ èªåç¨ã®ã³ããã¡ã¢ã§ãã PostgreSQLã§ãã¼ãã«ã®ãµã¤ãºãåå¾ãã¾ãã ãããç§ã®SQLåä½ãã⦠SELECT relname ,CASE WHEN relkind = 'r' THEN 'Tablee' WHEN relkind = 'S' THEN 'Sequence' WHEN relkind = 'i' THEN 'Index' WHEN relkind = 'v' THEN 'View' END ,to_char(reltuples, '999,999,999') AS rows ,pg_size_pretty(pg_relation_size(oid)) AS size FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspnam
æ¿å£ è²´è£ ããã¹ãæ¤ç´¢ã«ããã¾ãã¾ãªæ¹æ³ãããã¾ãã大éã®ããã¹ããæ¤ç´¢ããã«ã¯ã¤ã³ããã¯ã¹ã使ã£ã¦æ¤ç´¢ãããã¨ããã§ãããã©ããªæ¤ç´¢ã«ãå¿ããããã¤ã³ããã¯ã¹ã¨ãããã®ã¯ããããã«åå¨ãã¾ãããããããã®ã¢ããªã±ã¼ã·ã§ã³ã®æ¡ä»¶ã«é©ããããã¹ãæ¤ç´¢æ¹æ³ãã¤ã³ããã¯ã¹ã®å¼µãæ¹ãé¸ãã§è¡ãã¾ãããã ä»å説æããããã¹ãæ¤ç´¢ã®æ¹æ³ã®ä¸è¦§ã以ä¸ã«æãã¾ããPostgreSQL ã¦ã¼ã¶ããå ¨æããã¹ãæ¤ç´¢ãã¨ããã¨ãåèªåä½ã®æ¤ç´¢ããæããã¨ãå¤ãããã§ããã¾ãããä¸éä¸è´æ¤ç´¢ãããããã¾ãæ¤ç´¢ãã¨å¼ã°ãããã¨ãããããã§ããç¨èªãå³å¯ãªæå³ã§ä½¿ãããªããã¨ãå¤ããããªã®ã§ãæèã«ã¯æ³¨æãã¦è§£éãã¦ãã ããã ãåèªåä½ã®æ¤ç´¢ãã¨ãä¸éä¸è´æ¤ç´¢ãã§ã¯ã追å ã®ã¢ã¸ã¥ã¼ã«ãå°å ¥ãããã¨ã§æ¥æ¬èªå ¨ææ¤ç´¢ãå¯è½ãªã¤ã³ããã¯ã¹ãä½æã§ãã¾ãããã¡ãã¯èª¬æã®å¾åã§ç´¹ä»ãã¾ãã以ä¸ãæ¬è¨äºã®å 容ã§ãã ããã¹
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}