OS환경 : Oracle Linux 7.6 (64bit)
DB 환경 : PostgreSQL 10 + PostGIS 2.5.3
방법 : linux7.6에 PostgreSQL 10 + PostGIS 2.5.3 구성하기(root 계정으로 재시도)
코드에서 #은 root 유저이고 $은 postgres 유저를 나타냄
1 2 3 4 | # whoami root $ whoami postgres |
PostgreSQL 10 설치
https://www.postgresql.org 사이트에서 아래의 4개 파일을 다운로드 받음
(https://yum.postgresql.org/10/redhat/rhel-7-x86_64/repoview/)
postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm
다운받은 이후 순서대로 설치
설치되는 경로 : /usr/pgsql-10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # rpm -ivh postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-libs-10.10-1PGDG.rhe################################# [100%] # rpm -ivh postgresql10-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-10.10-1PGDG.rhel7 ################################# [100%] # rpm -ivh postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-server-10.10-1PGDG.r################################# [100%] # rpm -ivh postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-contrib-10.10-1PGDG.######################## ( 72%) ################################# [100%] |
5432 포트 방화벽 허용(기본 포트)
1 2 | # firewall-cmd --zone=public --add-port=5432/tcp success |
postgres 유저 생성 및 패스워드 변경
1 2 3 4 5 6 7 8 | # useradd postgres useradd: user 'postgres' already exists # passwd postgres Changing password for user postgres. New password: BAD PASSWORD: The password contains the user name in some form Retype new password: passwd: all authentication tokens updated successfully. |
root 유저 .bash_profile 수정
postgres 유저로 접속
1 | # su - postgres |
.bash_profile 수정
1 2 | -bash-4.2$ . ./.bash_profile // 기존:-bash-4.2$가 나옴 [postgres@PG ~]$ // 변경후: 유저명@hostname이나옴 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | $ $PGHOME/bin/initdb The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. creating directory /var/lib/pgsql/10/data ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default timezone ... Asia/Seoul selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data -l logfile start |
리스너의 유효 IP를 설정
1 2 3 4 | $ vi $PGDATA/postgresql.conf 59번 줄 수정 기존 : #listen_addresses = 'localhost' 수정 : listen_addresses = '*' |
PostgreSQL 프로세스가 사용할 temp 경로 지정
1 2 3 4 | $ vi $PGDATA/postgresql.conf 66번 줄 수정 기존 : #unix_socket_directories = '/var/run/postgresql, /tmp' 수정 : unix_socket_directories = '/var/lib/pgsql/10/data' |
외부 접속을 위한 보안 설정
1 2 3 4 5 6 7 | $ vi $PGDATA/pg_hba.conf # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 0.0.0.0/0 trust # IPv6 local connections: host all all ::1/128 trust |
postgreSQL 서비스 시작
PostgreSQL이 실행되지 않으면 해당 로그파일을 확인하여 문제를 조치해야함
1 2 3 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile start waiting for server to start.... done server started |
oracle의 sqlplus 같은 psql로 접속
1 2 3 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile start waiting for server to start.... done server started |
에러 발생
해결방법
먼저 $ cd /var/run/postgresql/ 경로로 이동해서 파일 확인
1 2 3 4 5 | $ cd /var/run/postgresql/ $ ls -al total 4 drwxr-xr-x. 2 postgres postgres 60 Oct 29 00:00 . drwxr-xr-x. 42 root root 1280 Oct 28 23:09 .. |
.s.PGSQL.5432 파일이 없음
psql 시 /var/run/postgresql/ 경로의 .s.PGSQL.5432를 바라보는데
이 파일이 $PGDATA 폴더의 .s.PGSQL.5432를 바라보도록 설정해줌(심볼릭링크)
1 2 3 4 5 6 7 | $ ln -s $PGDATA/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 $ ls -al /var/run/postgresql/ total 4 drwxr-xr-x. 2 postgres postgres 80 Oct 29 00:04 . drwxr-xr-x. 42 root root 1280 Oct 28 23:09 .. -rw-------. 1 postgres postgres 209 Oct 29 00:00 logfile lrwxrwxrwx. 1 postgres postgres 33 Oct 29 00:04 .s.PGSQL.5432 -> /home/postgres/DATA/.s.PGSQL.5432 |
다시 psql 접속 시도 후 버전확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | $ psql psql (10.10) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (3 rows) postgres=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) |
정상 접속됨
postgres 계정 패스워드 변경
1 2 3 4 | postgres=# \password postgres Enter new password: //postgres 입력 Enter it again: //postgres 입력 postgres=# \q |
샘플 유저 생성
1 2 3 4 5 6 | postgres=# create role scott login; CREATE ROLE postgres=# create user scott postgres-# \password scott Enter new password: //tiger 입력 Enter it again: //tiger 입력 |
PostgreGIS 2.5.3 설치
###필수 패키지 설치과정###
필수 requirement package 설치
http://postgis.net/docs/manual-2.5/postgis-ko_KR.html#install_requirements
필요한 필수 패키지 목록을 요약하면 아래와 같음
1 2 3 4 5 6 7 8 9 | Postgresql 9.4 이상 gcc gcc-c++ make proj 4.9 이상 geos 3.7 이상 libxml2 2.5이상 json-c 0.9이상 gdal 1.9이상 |
해당 패키지들 먼저 설치
gcc, gcc-c++, make는 OS 설치 시 패키지에 체크해서 이미 설치됨
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC) $ c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC) $ make -v GNU Make 3.82 Built for x86_64-redhat-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. |
proj 4.9 설치
https://proj.org/download.html 에 들어가서 proj-4.9.3.tar.gz 다운로드
1 | # tar -xvf proj-4.9.3.tar.gz |
압축 해제 한 폴더로 이동 후 설치
1 2 | # cd proj-4.9.3 # ./configure && make && make install |
설치 후 버전 확인(패키지명 -v)
1 2 3 4 5 6 | # proj -v Rel. 4.9.3, 15 August 2016 <proj>: projection initialization failure cause: no arguments in initialization list program abnormally terminated |
geos 3.7 설치
https://trac.osgeo.org/geos/ 에 들어가서 geos-3.7.3.tar.bz2 다운로드
서버에 업드로 한 다음 설치
압축 해제
1 | # tar -xvf geos-3.7.3.tar.bz2 |
bzip2 패키지가 없어서 설치되지 않는다면 bzip2 패키지 먼저 설치
1 2 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh bzip2-1.0.6-13.el7.x86_64.rpm |
압축 해제 한 폴더로 이동 후 설치
1 2 | # cd geos-3.7.3 # ./configure --prefix=$LOCALDESTDIR && make && make install |
1 2 | # geos-config --version 3.7.3 |
libxml2, json-c 설치
libxml2 와 json-c는 이미 설치가 되어있었음(설치된 버전이 요구사항에 충족함)
1 2 3 4 5 6 7 8 9 10 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh libxml2-2.9.1-6.0.1.el7_2.3.x86_64.rpm warning: libxml2-2.9.1-6.0.1.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] package libxml2-2.9.1-6.0.1.el7_2.3.x86_64 is already installed # rpm -ivh json-c-0.11-4.el7_0.x86_64.rpm warning: json-c-0.11-4.el7_0.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] package json-c-0.11-4.el7_0.x86_64 is already installed |
gdal 2.4.2 설치
1 | # tar -xvf gdal-2.2.2.tar.gz |
1 2 | # cd gdal-2.4.2/ # ./configure && make && make install |
###필수 패키지 설치과정###
PostGIS 다운로드
먼저 https://postgis.net/source/ 에 접속 후 postgis-2.5.3.tar.gz 다운로드
압축 해제
1 | # tar -xvf postgis-2.5.3.tar.gz |
압축 푼 경로로 이동해서 configure 실행
1 2 3 4 5 6 7 | # cd postgis-2.5.3 # ./configure . . checking for pg_config... /usr/pgsql-10/bin/pg_config configure: error: the PGXS Makefile /usr/pgsql-10/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure. |
postgresql development 패키지를 설치하라는 내용의 에러 발생
해당 패키지 설치
https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7Server-x86_64/ 접속 후
postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 다운로드
postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 설치
1 2 3 4 | # rpm -ivh postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY error: Failed dependencies: libicu-devel is needed by postgresql10-devel-10.10-1PGDG.rhel7.x86_64 |
libicu-devel 패키지를 먼저 설치해야함
Oracle linux 7.6 cd에서 해당 파일 찾아서 설치
다시 postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 설치
1 2 3 4 5 | # rpm -ivh postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-devel-10.10-1PGDG.rh################################# [100%] |
추가로 필요한 libxml2-devel을 설치하기 위해 xz-devel과 zlib-devel 먼저 설치 후 libxml2-devel 설치
OS CD에 들어있는 패키지 사용
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh xz-devel-5.2.2-1.el7.x86_64.rpm warning: xz-devel-5.2.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:xz-devel-5.2.2-1.el7 ################################# [100%] # rpm -ivh zlib-devel-1.2.7-18.el7.x86_64.rpm warning: zlib-devel-1.2.7-18.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zlib-devel-1.2.7-18.el7 ################################# [100%] # rpm -ivh libxml2-devel-2.9.1-6.0.1.el7_2.3.x86_64.rpm warning: libxml2-devel-2.9.1-6.0.1.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:libxml2-devel-2.9.1-6.0.1.el7_2.3################################# [100%] |
다시 설치(libxml2-devel을 설치했기 때문에 --with-xml2config 옵션을 안넣어줘도 돌아감)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # cd postgis-2.5.3 # ./configure . . PostGIS is now configured for x86_64-pc-linux-gnu -------------- Compiler Info ------------- C compiler: gcc -g -O2 SQL preprocessor: /bin/cpp -traditional-cpp -w -P -------------- Additional Info ------------- Interrupt Tests: DISABLED use: --with-interrupt-tests to enable -------------- Dependencies -------------- GEOS config: /bin/geos-config GEOS version: 3.7.3 GDAL config: /usr/local/bin/gdal-config GDAL version: 2.4.2 PostgreSQL config: /usr/pgsql-10/bin/pg_config PostgreSQL version: PostgreSQL 10.10 PROJ4 version: 49 Libxml2 config: /bin/xml2-config Libxml2 version: 2.9.1 JSON-C support: no protobuf-c support: no PCRE support: no Perl: /bin/perl --------------- Extensions --------------- PostGIS Raster: enabled PostGIS Topology: enabled SFCGAL support: disabled Address Standardizer support: disabled -------- Documentation Generation -------- xsltproc: /bin/xsltproc xsl style sheets: dblatex: convert: mathml2.dtd: http://www.w3.org/Math/DTD/mathml2/mathml2.dtd |
제대로 설치가 됨
make와 make install 실행
1 | # make && make install |
postgresql 서비스 재시작
1 2 3 4 5 6 7 | # su - postgres Last login: Tue Oct 29 04:20:15 KST 2019 on pts/0 $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile restart waiting for server to shut down.... done server stopped waiting for server to start.... done server started |
psql 접속 후 설치 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | $ psql psql (10.10) Type "help" for help. postgres=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) postgres=# SELECT name, default_version,installed_version postgres-# FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%'; name | default_version | installed_version ------------------------+-----------------+------------------- postgis | 2.5.3 | postgis_tiger_geocoder | 2.5.3 | postgis_topology | 2.5.3 | (3 rows) |
PostGIS extension 생성
1 2 3 4 5 6 7 | $ psql psql (10.10) Type "help" for help. postgres=# create extension postgis; ERROR: could not load library "/usr/pgsql-10/lib/postgis-2.5.so": libgeos_c.so.1: cannot open shared object file: No such file or directory postgres=# \q |
에러로 만들어지지않음
ldd 명령으로 해당 라이브러리 확인
1 2 3 4 5 6 7 8 9 10 11 12 | $ ldd /usr/pgsql-10/lib/postgis-2.5.so linux-vdso.so.1 => (0x00007ffce39d1000) libgeos_c.so.1 => not found libproj.so.12 => not found libxml2.so.2 => /lib64/libxml2.so.2 (0x00007ffa731de000) libm.so.6 => /lib64/libm.so.6 (0x00007ffa72edc000) libc.so.6 => /lib64/libc.so.6 (0x00007ffa72b0f000) libdl.so.2 => /lib64/libdl.so.2 (0x00007ffa7290b000) libz.so.1 => /lib64/libz.so.1 (0x00007ffa726f5000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007ffa724cf000) /lib64/ld-linux-x86-64.so.2 (0x00007ffa737fd000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffa722b3000) |
다른건 찾을수 있으나 libgeos_c.so.1와 libproj.so.12 를 찾을수 없다고 나옴
find 명령으로 해당 파일들 위치 검색
1 2 3 4 5 | $ cd /usr $ find . -name "*geos*" ./local/lib/libgeos_c.so.1 $ find . -name "*libproj*" ./local/lib/libproj.so.12 |
2개파일 모두 /usr/local/lib에 위치하고 있음
.bash_profile의 LD_LIBRARY_PATH 제일 뒤에 :/usr/local/lib 를 넣음
1 2 | $ vi .bash_profile export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/pgsql-10/lib:/usr/local/lib |
적용 후 ldd 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $ . ./.bash_profile $ ldd /usr/pgsql-10/lib/postgis-2.5.so linux-vdso.so.1 => (0x00007fff64d09000) libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00007feed2209000) libproj.so.12 => /usr/local/lib/libproj.so.12 (0x00007feed1fa0000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007feed1c36000) libm.so.6 => /lib64/libm.so.6 (0x00007feed1934000) libc.so.6 => /lib64/libc.so.6 (0x00007feed1567000) libgeos-3.7.3.so => /usr/local/lib/libgeos-3.7.3.so (0x00007feed11b6000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007feed0eaf000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feed0c99000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feed0a7d000) libdl.so.2 => /lib64/libdl.so.2 (0x00007feed0879000) libz.so.1 => /lib64/libz.so.1 (0x00007feed0663000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feed043d000) /lib64/ld-linux-x86-64.so.2 (0x00007feed26f1000) |
정상적으로 바라보고 있음
postgresql 서비스 재시작
1 2 3 4 5 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile restart waiting for server to shut down.... done server stopped waiting for server to start.... done server started |
PostGIS extension 다시 생성
1 2 3 4 5 6 | $ psql psql (10.10) Type "help" for help. postgres=# create extension postgis; CREATE EXTENSION |
정상적으로 생성됨
버전확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | postgres=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) postgres=# select postgis_version(); postgis_version --------------------------------------- 2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 (1 row) postgres=# SELECT PostGIS_Full_Version(); postgis_full_version ----------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------- POSTGIS="2.5.3 r17699" [EXTENSION] PGSQL="100" GEOS="3.7.3-CAPI-1.11.3 b50468f" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.4.2, released 2019/06/28" LIBXML="2.9.1" RASTER (1 row) |
postgresql, postgis 모두 정상적으로 버전이 나옴
PostGIS 2.5 메뉴얼에 있는 SELECT ST_GeomFromText 함수 사용 테스트
http://postgis.net/docs/manual-2.5/postgis-ko_KR.html#idm527
1 2 3 4 5 | postgres=# SELECT ST_GeomFromText('LINESTRING(-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932)'); st_geomfromtext -------------------------------------------------------------------------------------------------------------------- 010200000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540 (1 row) |
정상적으로 나옴
st_isvalid 함수 써서 확인
1 2 3 4 5 | postgres=# SELECT st_isvalid(ST_GeomFromText('LINESTRING(-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932)')); st_isvalid ------------ t (1 row) |
'PostgreSQL > Install' 카테고리의 다른 글
PostgreSQL 10 환경에서 collate ko_kr.utf-8 로 database 생성하기 (0) | 2019.11.05 |
---|---|
PostgreSQL 10, oracle fdw extension 생성방법 (0) | 2019.10.28 |
linux7.6에 PostgreSQL 10 + PostGIS 2.5.3 구성하기(실패) (0) | 2019.10.28 |
Postgresql 과 PostGIS의 지원 매트릭스 문서 (0) | 2019.10.25 |
linux7.6에 PostgreSQL 12 + PostGIS 3.0 구성하기(실패) (0) | 2019.10.19 |