PostgreSQL adminpack extention 설치
pgAdmin 사용중 DB 접속할 때마다 자꾸만 팝업 안내창이 뜨길래
PostgreSQL adminpack extention을 설치했다.


주의: 모든 db에 대해 CREATE EXTENSION adminpack; 실행해야 한다고 함.
     그렇게 해줘야 pgAdmin III 에서 DB접속시 경고가 사라진다.

$ cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)
$ sudo yum install postgresql-contrib
$ rpm -ql postgresql-contrib
/usr/share/pgsql/extension/adminpack--1.0.sql
/usr/share/pgsql/extension/adminpack.control
$ sudo -u postgres psql
psql (9.2.13)
Type "help" for help.

postgres=# select * from pg_extension;
 extname | extowner | extnamespace | extrelocatable | extversion | extconfig | e
xtcondition
---------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql |       10 |           11 | f              | 1.0        |           |
(1 row)

postgres=# CREATE EXTENSION adminpack;
CREATE EXTENSION
postgres=# select * from pg_extension;
  extname  | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
-----------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql   |       10 |           11 | f              | 1.0        |           |
 adminpack |       10 |           11 | f              | 1.0        |           |
(2 rows)

postgres=# \c xtdata
You are now connected to database "xtdata" as user "postgres".
xtdata=# select * from pg_extension;
 extname | extowner | extnamespace | extrelocatable | extversion | extconfig | e
xtcondition
---------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql |       10 |           11 | f              | 1.0        |           |
(1 row)

xtdata=# CREATE EXTENSION adminpack;
CREATE EXTENSION
xtdata=# select * from pg_extension;
  extname  | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
-----------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql   |       10 |           11 | f              | 1.0        |           |
 adminpack |       10 |           11 | f              | 1.0        |           |
(2 rows)

xtdata=# CREATE EXTENSION adminpack;
CREATE EXTENSION
xtdata=# \q
$

Ubuntu 14.04, Postgresql-9.3 에서도 아래와 같이 비슷하게 하면 됨.


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:        14.04
Codename:       trusty
$ sudo apt-get install postgresql-contrib
$ dpkg-query -L postgresql-contrib-9.3 | grep adminpack
/usr/share/postgresql/9.3/extension/adminpack--1.0.sql
/usr/share/postgresql/9.3/extension/adminpack.control
/usr/lib/postgresql/9.3/lib/adminpack.so
$ sudo -u postgres psql
psql (9.3.10)
Type "help" for help.

postgres=# select * from pg_extension;
 extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
---------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql |       10 |           11 | f              | 1.0        |           |
(1 row)

postgres=# CREATE EXTENSION adminpack;
CREATE EXTENSION
postgres=# select * from pg_extension;
  extname  | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
-----------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql   |       10 |           11 | f              | 1.0        |           |
 adminpack |       10 |           11 | f              | 1.0        |           |
(2 rows)

postgres=# \c xtdata
You are now connected to database "xtdata" as user "postgres".
xtdata=# select * from pg_extension;
 extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
---------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql |       10 |           11 | f              | 1.0        |           |
(1 row)

xtdata=# CREATE EXTENSION adminpack;
CREATE EXTENSION
xtdata=# select * from pg_extension;
  extname  | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
-----------+----------+--------------+----------------+------------+-----------+--------------
 plpgsql   |       10 |           11 | f              | 1.0        |           |
 adminpack |       10 |           11 | f              | 1.0        |           |
(2 rows)

xtdata=# \q
$


그런데, CentOS5의 postgresql84 에서는 아래와 같이 좀 달랐음.

- Setting Up pgAdmin Server Instrumentation
    http://www.gistutor.com/postgresqlpostgis/6-advanced-postgresqlpostgis-tutorials/32-setting-up-pgadmin-server-instrumentation.html

- An almost idiot's guide to Install and Upgrade to PostgreSQL 8.4 with Yum
    http://www.postgresonline.com/journal/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html

$ lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 5.11 (Final)
Release:        5.11
Codename:       Final
$ sudo yum install postgresql84-contrib
$ rpm -ql postgresql84-contrib | grep adminpack
/usr/lib64/pgsql/adminpack.so
/usr/share/pgsql/contrib/adminpack.sql
/usr/share/pgsql/contrib/uninstall_adminpack.sql
$ sudo -u postgres psql
psql (8.4.20)
도움말을 보려면 "help"를 입력하십시오.

postgres=# select * from pg_extension;
오류:  "pg_extension" 이름의 릴레이션(relation)이 없습니다
줄 1: select * from pg_extension;
                    ^
postgres=# CREATE EXTENSION adminpack;
오류:  구문 오류, "EXTENSION" 부근
줄 1: CREATE EXTENSION adminpack;
             ^
postgres=# \q
$ sudo -u postgres psql -f /usr/share/pgsql/contrib/adminpack.sql
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
$

by 시험さま | 2015/11/12 12:56 | 컴퓨터 | 트랙백 | 덧글(0)
트랙백 주소 : http://chanik.egloos.com/tb/4099791
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글

< 이전페이지 다음페이지 >