<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.garamx.com/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://www.garamx.com/dokuwiki/feed.php">
        <title>GaramX postgresql</title>
        <description></description>
        <link>https://www.garamx.com/dokuwiki/</link>
        <image rdf:resource="https://www.garamx.com/dokuwiki/lib/tpl/darkblue/images/favicon.ico" />
       <dc:date>2026-05-06T13:40:20+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:apt&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup_and_restore&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:comments&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:configuration&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:descript&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:home&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:install&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:pg_upgrade&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:psql&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:recursive&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:replication&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:service&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:upgrade&amp;rev=1744711518&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:vacuum&amp;rev=1744711518&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://www.garamx.com/dokuwiki/lib/tpl/darkblue/images/favicon.ico">
        <title>GaramX</title>
        <link>https://www.garamx.com/dokuwiki/</link>
        <url>https://www.garamx.com/dokuwiki/lib/tpl/darkblue/images/favicon.ico</url>
    </image>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:apt&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:apt</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:apt&amp;rev=1744711518&amp;do=diff</link>
        <description>Debian12(Bookwarm)부터 apt키 관리하는 것이 변경되었다. apt-key를 더 이상 사용하지 못한다고 하네.

아래는 이전 버전으로 key를 수동으로 생성하는 방법으로 bookwarm에서 적용해 보았다.
1. 관련 키 다운로드</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup_and_restore&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:backup_and_restore</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup_and_restore&amp;rev=1744711518&amp;do=diff</link>
        <description>Backup And Restore

Backup


#DB 정보설정
dbname=postgre
port=5432
username=postgre
if [ &quot;&quot; != &quot;$1&quot; ]; then
	file_name=$1
else
	host_name=db.xxxx.com
	file_name=db_xxxx_backup.gz
fi

read -p &quot;백업하려는서버($host_name): &quot; name

if [ -n &quot;$name&quot; ]; then
	host_name=&quot;$name&quot;
fi

startDate=$(date)
echo &quot;================================&quot;
echo &quot;== 장고-데이터를 백업시작합니다.&quot;
echo &quot;== 서버 : $host_name&quot;
echo &quot;== start time : ${startDate}&quot;
echo &quot;================================&quot;

&lt;&lt;comment
Postgresql의 pg_dump를 이용한 백업을 실시합니다.
co…</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:backup</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:backup&amp;rev=1744711518&amp;do=diff</link>
        <description>Backup

SQL 덤프 백업

pg_dump

pg_dump를 이용한 백업방법입니다.


% pg_dump DB_NAME &gt; DB_NAME_dump.sql


pg_dump 연결 옵션

Connection options:


  -d, --dbname=DBNAME      database to dump
  -h, --host=HOSTNAME      database server host or socket directory
  -p, --port=PORT          database server port number
  -U, --username=NAME      connect as specified database user
  -w, --no-password        never prompt for password
  -W, --password           force password prompt (should happen automatically)…</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:comments&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:comments</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:comments&amp;rev=1744711518&amp;do=diff</link>
        <description>Table, Column Comments

1. 테이블의 주석(코멘트/설명) 출력


/* 테이블 주석 셀렉트 */
SELECT N.NSPNAME, C.RELNAME, OBJ_DESCRIPTION(C.OID) 
FROM PG_CATALOG.PG_CLASS C INNER JOIN PG_CATALOG.PG_NAMESPACE N ON C.RELNAMESPACE=N.OID 
WHERE C.RELKIND = &#039;r&#039;
AND NSPNAME = &#039;스키마명&#039;
AND RELNAME = &#039;테이블명&#039;</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:configuration&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:configuration</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:configuration&amp;rev=1744711518&amp;do=diff</link>
        <description>PostgresSQL 설정하기

pg_hba.conf

	*  Client Authentication
	*  /etc/postgresql/14/..pg_hba.con에서 설정-linux Service

postgresql.conf

port 설정


port = 5432                            # (change requires restart)


log 설정

	*  Log설정

Version
select version();
show server_version;</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:descript&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:descript</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:descript&amp;rev=1744711518&amp;do=diff</link>
        <description>postgresql comment

Comment

Comment만들기


comment on table table_Name is &#039;comment&#039;;



comment on column tableName.columnName is &#039;코멘트&#039;;


Comment보기


/* 테이블 주석 셀렉트 */
SELECT N.NSPNAME, C.RELNAME, OBJ_DESCRIPTION(C.OID) 
FROM PG_CATALOG.PG_CLASS C INNER JOIN PG_CATALOG.PG_NAMESPACE N ON C.RELNAMESPACE=N.OID 
WHERE C.RELKIND = &#039;r&#039;
AND NSPNAME = &#039;데이터베이스명&#039;
AND RELNAME = &#039;테이블명&#039;</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:home&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:home</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:home&amp;rev=1744711518&amp;do=diff</link>
        <description>PostgreSQL

	*  설정하기
	*  Backup
	*  Install
	*  Table Description
	*  Recursive Query - Oracle의 START WITH, CONNECT BY PRIOR와 유사
	*  postgresql 서비스
	*  Table, Column Comment보기
	*  Backup And Restore
	*  Upgrade
	*  Replication 구축하기
	*  Apt 등록
	*  pg_upgrade를 이용한 Version Up
	*  VACUUM

	*  psql 사용하기

Start / Stop

macOS에서 Server.app이 있으면 postgres가 기본으로 설치되어 있다.
9.4, 12.4 -&gt; 9.4는 잘되는데 12.4는 어떻게 하는지 모르겠다.
brew을 이용하여 설치하ㅡㄴ 것을 추천한다.…</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:install&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:install</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:install&amp;rev=1744711518&amp;do=diff</link>
        <description>PostgreSQL 설치

여기서 자세한 설명을 본다.
&lt;https://www.postgresql.org/download/&gt;

아래에 있는 것은 쓰레기 위의 것을 참조하세요.

Linux Ubuntu

필수 패키지 설치

데이터베이스 소프트웨어 설치를 지원하려면 다음 패키지를 설치해야 합니다.</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:pg_upgrade&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:pg_upgrade</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:pg_upgrade&amp;rev=1744711518&amp;do=diff</link>
        <description>pg_upgrade (upgrade a PostgreSQL server instance)

PostgreSQL Major Version 업그레이드하기 위해서 사용

PostgreSQL pg_upgrade

pg_upgrade (이전 명칭 pg_migrator )를 사용하면 PostgreSQL 데이터 파일 에 저장된 데이터를 일반적으로 주요 버전 업그레이드(예: 12.14에서 13.10 또는 14.9에서 15.5)에 필요한 데이터 덤프/복원 없이 이후 PostgreSQL 주요 버전으로 업그레이드할 수 있습니다. 12.7에서 12.8 또는 14.1에서 14.5로의 마이너 버전 업그레이드에는 필요하지 않습니다.…</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:psql&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:psql</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:psql&amp;rev=1744711518&amp;do=diff</link>
        <description>psql

	*  psql 사용팁

입력/출력 관련


  \g [(OPTIONS)] [FILE]  쿼리 실행 (결과는 지정한 파일로, 또는 |파이프로);
                         \g 명령에서 인자가 없으면 세미콜론과 같음

  \e [FILE] [LINE]       외부 편집기로 쿼리 버퍼(또는 파일) 편집
  \ef [FUNCNAME [LINE]]  외부 편집기로 해당 함수 내용 편집
  \ev [VIEWNAME [LINE]]  외부 편집기로 해당 뷰 정의 편집
  \p                     쿼리 버퍼의 내용 표시
  \r                     쿼리 버퍼 초기화(모두 지움)
  \s [FILE]              기록 표시 또는 파일에 저장
  \w FILE                쿼리 버퍼를 파일에 기록

  \i FILE                파일에서 명령 실행
  \o [FILE]              모든…</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:recursive&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:recursive</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:recursive&amp;rev=1744711518&amp;do=diff</link>
        <description>Reccursive Query


WITH RECURSIVE MENU_LIST(ID, PARENT_ID, MENU_CD, MENU_NAME, ORD, DEPTH, PATH, CYCLE) AS (
SELECT ID, PARENT_ID, MENU_CD, MENU_NAME, ORD,
               1 DEPTH,
               -- ARRAY[ID::text],
               ARRAY[ID],
              false
  FROM GOV_APPMENU A
WHERE MENU_CD = &#039;ADM&#039;

UNION ALL
/* 하위 데이터를 찾아가기 위한 반복조건 쿼리 */
SELECT A.ID, A.PARENT_ID, A.MENU_CD, A.MENU_NAME, A.ORD,
               B.DEPTH + 1 DEPTH,
               --ARRAY_APPEND(B.PATH, A.ID::text),
             …</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:replication&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:replication</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:replication&amp;rev=1744711518&amp;do=diff</link>
        <description>PostgreSQL Replication

자! 서버복제를 구성하여 보자! 어떻게 되는지 하나 하나 알아 보자고요.

여러가지 방법이 있습니다. 분석을 해야하나 장단점이 있는데 좀 알아보고 맞는 것 찾아봐야 겠습니다.</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:service&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:service</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:service&amp;rev=1744711518&amp;do=diff</link>
        <description>Debian, Ubuntu 서비스

서비스설정파일들

debian 서비스파일위치 : /lib/systemd/system/postgresql@.service


pg_lsclusters --&gt; cluster에 등록된 내용,  Data directory와 Log file의 설정내용확인


설정파일위치 : /etc/postgresql/14/main/</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:upgrade&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:upgrade</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:upgrade&amp;rev=1744711518&amp;do=diff</link>
        <description>postgreSQL upgrade


initdb --locale=ko_KR -E UTF-8 /usr/local/var/postgresql@16


pg_upgrade를 이용하려 하였으나 아직 용도 파악이 안됩니다.</description>
    </item>
    <item rdf:about="https://www.garamx.com/dokuwiki/doku.php?id=postgresql:vacuum&amp;rev=1744711518&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-04-15T10:05:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>postgresql:vacuum</title>
        <link>https://www.garamx.com/dokuwiki/doku.php?id=postgresql:vacuum&amp;rev=1744711518&amp;do=diff</link>
        <description>VACUUM

	*  PostgreSQL Vacuum

Introduction

PostgreSQL만의 특성 때문에 Table정리가 필요하다.

Vacuum은 PostgreSQL의 MVCC 구현 방법이 Oracle이나 MySQL 등 다른 DBMS와 다르고
그 차이로 인해 발생하는 문제점을 해결하기 위한 PostgreSQL만의 특별한 동작인데요.</description>
    </item>
</rdf:RDF>
