ã¯ããã«
ãã®è¨äºã§ã¯ãAIã¢ã·ã¹ã¿ã³ãCopilotã¨å¯¾è©±ãéãã¦ä½æããããPostgreSQLã«ã¤ã³ã¹ãã¼ã«ããã¦ããæ¡å¼µæ©è½ã確èªããæé ããç´¹ä»ãã¾ãã
æé 1: SQLã¯ã¨ãªã使ç¨ããæ¹æ³
ããã³ãã
æåã«ãpostgresqlã«ã©ã®ãããªæ¡å¼µæ©è½ãå ¥ã£ã¦ããã®ã確èªããæ¹æ³ããCopilotã«å°ãã¾ããã
postgresqlã«ãã©ã®ãããªæ¡å¼µæ©è½ãå ¥ã£ã¦ããã®ãã確èªããæ¹æ³ãæãã¦ãã ãããç§ã¯ããã®æé ãããã¥ã¡ã³ãã«ã¾ã¨ããå¿ è¦ãããã¾ãã
åç
PostgreSQLã«ã¤ã³ã¹ãã¼ã«ããã¦ããæ¡å¼µæ©è½ã確èªããããã«ã¯ã以ä¸ã®æé ãå®è¡ãã¾ãã
PostgreSQLãã¼ã¿ãã¼ã¹ã«æ¥ç¶ãã¾ããããã¯é常ã以ä¸ã®ã³ãã³ãã使ç¨ãã¦è¡ãã¾ã:
bash psql -h hostname -U username -d database
ããã§ãhostname
ã¯ãã¹ãåãusername
ã¯ã¦ã¼ã¶ã¼åãdatabase
ã¯ãã¼ã¿ãã¼ã¹åã§ãã次ã«ã以ä¸ã®SQLã³ãã³ããå®è¡ãã¾ã:
sql SELECT * FROM pg_extension;
ãã®ã³ãã³ãã¯ãã¤ã³ã¹ãã¼ã«ããã¦ãããã¹ã¦ã®æ¡å¼µæ©è½ã®ãªã¹ããè¿ãã¾ãã
æé 2: \dx
ã³ãã³ãã使ç¨ããæ¹æ³
ããã³ãã
ã\dxãã¨ããã³ãã³ãã§ç¢ºèªãããã¨ãã§ãã¾ããï¼
åç
ã¯ãããã®éãã§ããã\dx
ãã¯ãPostgreSQLã®ã³ãã³ãã©ã¤ã³ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ããpsql
å
ã§ä½¿ç¨ã§ããã³ãã³ãã®ä¸ã¤ã§ããã¼ã¿ãã¼ã¹ã«ã¤ã³ã¹ãã¼ã«ããã¦ããæ¡å¼µæ©è½ã®ãªã¹ãã表示ãã¾ãã
以ä¸ã«ããã®æé ã示ãã¾ãï¼
PostgreSQLãã¼ã¿ãã¼ã¹ã«æ¥ç¶ãã¾ããããã¯é常ã以ä¸ã®ã³ãã³ãã使ç¨ãã¦è¡ãã¾ã:
bash psql -h hostname -U username -d database
ããã§ãhostname
ã¯ãã¹ãåãusername
ã¯ã¦ã¼ã¶ã¼åãdatabase
ã¯ãã¼ã¿ãã¼ã¹åã§ãã次ã«ã以ä¸ã®ã³ãã³ããå®è¡ãã¾ã:
bash \dx
ãã®ã³ãã³ãã¯ãã¤ã³ã¹ãã¼ã«ããã¦ãããã¹ã¦ã®æ¡å¼µæ©è½ã®ãªã¹ããè¿ãã¾ãã
ãSELECT * FROM pg_extension;ãã¨ãã\dxãã³ãã³ãã®éã
ãSELECT * FROM pg_extension;ãã¨ãã\dxãã³ãã³ãã¯PostgreSQLã§ä½¿ç¨ããããã¼ã¿ãã¼ã¹ã®æ¡å¼µæ©è½ã«é¢ããæ å ±ãæä¾ãã¾ããã表示ãããæ å ±ã«ã¯è¥å¹²ã®éããããã¾ãã
SELECT * FROM pg_extension;
ã¯SQLã¯ã¨ãªã§ãpg_extensionãã¼ãã«ãããã¹ã¦ã®è¡ãé¸æãã¾ãããã®ãã¼ãã«ã¯ãã¤ã³ã¹ãã¼ã«ããã¦ããåæ¡å¼µæ©è½ã®è©³ç´°ãªæ å ±ãæä¾ãã¾ããããã«ã¯ãæ¡å¼µæ©è½ã®ååãOIDãã¹ãã¼ãã®OIDããã¼ã¸ã§ã³ããã¤ããªãã¼ã¸ã§ã³ãªã©ãå«ã¾ãã¾ããä¸æ¹ã
\dx
ã¯psqlã³ãã³ãã§ãã¤ã³ã¹ãã¼ã«ããã¦ããæ¡å¼µæ©è½ã®ãªã¹ãã表示ãã¾ãããã ããããã¯æ¡å¼µæ©è½ã®ååã¨ãã¼ã¸ã§ã³ã®ã¿ã表示ããpg_extensionãã¼ãã«ãæä¾ãããã詳細ãªæ å ±ã¯æä¾ãã¾ããã
ãããã£ã¦ããã詳細ãªæ
å ±ãå¿
è¦ãªå ´å㯠SELECT * FROM pg_extension;
ã使ç¨ããæ¡å¼µæ©è½ã®æ¦è¦ã ããå¿
è¦ãªå ´å㯠\dx
ã使ç¨ããã¨è¯ãã§ããããã©ã¡ãã®ã³ãã³ããPostgreSQLãã¼ã¿ãã¼ã¹ã®æ¡å¼µæ©è½ã«é¢ããæç¨ãªæ
å ±ãæä¾ãã¾ããããã®è©³ç´°åº¦ã¨è¡¨ç¤ºãããæ
å ±ã®ç¨®é¡ã«éããããã¾ãã
æé ã®ä½ææ¹æ³
- https://www.bing.com/chatã«ã¢ã¯ã»ã¹ãã¾ãã
- å ¥åæ¬ã«ããã³ããã®å 容ãå ¥åããéä¿¡ãã¾ãã
- å¿ è¦ã«å¿ãã¦å¯¾è©±ãç¹°ãè¿ãã¾ãã
ãã£ã¦ã¿ãææ³
- ãç§ã¯ããã®æé ãããã¥ã¡ã³ãã«ã¾ã¨ããå¿ è¦ãããã¾ãããã¨ããã³ã³ããã¹ããä»å ããã¨ãããæé æ¸ä½æã®å ·ä½çãªã¢ããã¤ã¹ãå¾ããã¾ããã
- ãSELECT * FROM pg_extension;ãã¨ãã\dxãã³ãã³ãã®éããæ確ã«ãªãã¾ãããããã¯ãåç´ã«æ¤ç´¢ã¨ã³ã¸ã³ã§èª¿ã¹ã以ä¸ã®å¹æãããã¨æãã¾ãã