Code Monkey home page Code Monkey logo

geospatial's Introduction

geospatial repo

PostGIS 3.3.2 for Greenplum 7.x

License

This project is developed under GPL v2, because PostGIS is GPL v2.

How to compile it

Currently, we support building geospatial on rhel/centos. To compile geospatial form source code, please install the following third-party libraries as described in README.libs. For normal use without raster, please install json-c, geos and proj.4. To enable raster functionality, please install gdal and expat. The minimum version requirments are listed in Makefile.version.

Before setting up geospatial, please make sure GPDB is installed correctly. To compile and install geospatial, use following command:

cd postgis/build/postgis-3.3.2/
./autogen.sh
./configure --with-pgconfig=$GPHOME/bin/pg_config --with-raster --without-topology --prefix=$GPHOME
make USE_PGXS=1 clean all install

Here USE_PGXS will specify the correct install path to gpdb.

Note that if psql is in path, there is no need to use --with-pgconfig flag.

How to use it

After installing geospatial extension, run the following commands to enable it:

psql mydatabase
mydatabase# CREATE EXTENSION postgis; -- enables postgis and raster
mydatabase# CREATE EXTENSION fuzzystrmatch; -- required for installing tiger geocoder
mydatabase# CREATE EXTENSION postgis_tiger_geocoder; -- enables tiger geocoder
mydatabase# CREATE EXTENSION address_standardizer; -- enable address_standardizer
mydatabase# CREATE EXTENSION address_standardizer_data_us;

To configure raster utilities, please set the following environment variables on the master host and all the segment hosts. A suggested way to do this is to add these variables into your $GPHOME/greenplum_path.sh file to ensure they get set in all the segment hosts and the master host. Make sure that you restart the database after setting them.

export GDAL_DATA=$GPHOME/share/gdal
export POSTGIS_ENABLE_OUTDB_RASTERS=0
export POSTGIS_GDAL_ENABLED_DRIVERS=DISABLE_ALL

Note: to guarantee that make check test cases run correctly, all the gdal drivers are disabled. To enable specific types of gdal drivers for a certain use case, please refer to this postgis manual. An example can be like this:

POSTGIS_GDAL_ENABLED_DRIVERS="GTiff PNG JPEG GIF XYZ"

In near future we plan to create GUCs for these variables after we backport necessary features into the gpdb repository.

Workaround for missing .so files

If any of the third party libraries are not installed in the default system path, you may see this issue while running the postgis.sql file

psql -d mydatabase -f ${GPHOME}/share/postgresql/contrib/postgis-3.3/postgis.sql
postgis-3.so": libgeos_c.so.1: cannot open shared object file: No such file or directory

This may happen because postgis.so cannot find one or more of the third party .so files to link against. Here is a workaround

  1. Edit /etc/ld.so.conf and add all the non default library paths that are used by geospatial.

For e.g. if you compiled and installed proj in /tmp/proj-install, this is how /etc/ld.so.conf would look like

   include ld.so.conf.d/*.conf
   /tmp/proj-install/lib
  1. Run ldconfig

geospatial's People

Contributors

baishaoqi avatar cove9988 avatar haozhouwang avatar jingyimei avatar kaknikhil avatar khannaekta avatar orhankislal avatar sanath97 avatar shrakesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geospatial's Issues

/postgis.control is missing in /usr/local/greenplum-db-6.13.0/share/postgresql/extension/

the master version installed on GreenPlum 6.13.0 and 6.12.1 both had this problem, compile and install successfully,could not create extension.

 PostgreSQL 9.4.24 (Greenplum Database 6.13.0 build commit:4f1adf8e247a9685c19ea02bcaddfdc200937ecd Open Source) on x86_
64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Dec 18 2020 22:31:16

OS:

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.9.2009 (Core)
Release:        7.9.2009
Codename:       Core

pg_config

BINDIR = /usr/local/greenplum-db-6.13.0/bin
DOCDIR = /usr/local/greenplum-db-6.13.0/share/doc/postgresql
HTMLDIR = /usr/local/greenplum-db-6.13.0/share/doc/postgresql
INCLUDEDIR = /usr/local/greenplum-db-6.13.0/include
PKGINCLUDEDIR = /usr/local/greenplum-db-6.13.0/include/postgresql
INCLUDEDIR-SERVER = /usr/local/greenplum-db-6.13.0/include/postgresql/server
LIBDIR = /usr/local/greenplum-db-6.13.0/lib
PKGLIBDIR = /usr/local/greenplum-db-6.13.0/lib/postgresql
LOCALEDIR = /usr/local/greenplum-db-6.13.0/share/locale
MANDIR = /usr/local/greenplum-db-6.13.0/man
SHAREDIR = /usr/local/greenplum-db-6.13.0/share/postgresql
SYSCONFDIR = /usr/local/greenplum-db-6.13.0/etc/postgresql
PGXS = /usr/local/greenplum-db-6.13.0/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-debug-extensions' '--disable-tap-tests' '--enable-orca' '--with-zstd' '--with-gssapi' '--with-libxml' '--with-perl' '--with-python' '--with-openssl' '--with-pam' '--with-ldap' '--with-extra-version= Open Source' '--prefix=/usr/local/greenplum-db-6.13.0' '--mandir=/usr/local/greenplum-db-6.13.0/man' 'CC=gcc' 'CFLAGS=-O3 -fargument-noalias-global -fno-omit-frame-pointer -g'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/greenplum-db-6.13.0/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fno-aggressive-loop-optimizations -Wno-unused-but-set-variable -Wno-address -O3 -fargument-noalias-global -fno-omit-frame-pointer -g -std=gnu99 -Werror=uninitialized -Werror=implicit-function-declaration -I/usr/local/greenplum-db-6.13.0/include
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/usr/local/greenplum-db-6.13.0/lib',--enable-new-dtags -L/usr/local/greenplum-db-6.13.0/lib
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxerces-c -lxml2 -lpam -lrt -lgssapi_krb5 -lzstd -lrt -lcrypt -ldl -lm -L/usr/local/greenplum-db-6.13.0/lib
VERSION = PostgreSQL 9.4.24

configure

# ./configure --with-pgconfig=$GPHOME/bin/pg_config --with-raster --without-topology --prefix=$GPHOME
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for cpp... /usr/bin/cpp
checking if gcc supports -Wall... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -ffloat-store... yes
checking if gcc supports --exclude-libs... yes
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether isfinite is declared... yes
checking whether isfinite is declared... yes
checking for perl... /usr/bin/perl
checking for xsltproc... no
configure: WARNING: xsltproc is not installed so documentation cannot be built
checking for convert... no
configure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be built
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
checking for xmllint... /usr/bin/xmllint
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking CUnit/CUnit.h usability... yes
checking CUnit/CUnit.h presence... yes
checking for CUnit/CUnit.h... yes
checking for CU_initialize_registry in -lcunit... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
Using user-specified pg_config file: /usr/local/greenplum-db-6.13.0/bin/pg_config
checking PostgreSQL version... PostgreSQL 9.4.24
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... yes
------------------------------------------------------------------------
  WARNING: You have set the --prefix to '/usr/local/greenplum-db-6.13.0'. But we mostly
  ignore the --prefix. For your info, using the values determined from
  /usr/local/greenplum-db-6.13.0/bin/pg_config we will be installing:
    * postgis shared library in /usr/local/greenplum-db-6.13.0/lib
    * postgis SQL files in /usr/local/greenplum-db-6.13.0/share/postgresql/contrib/postgis-2.5
    * postgis executables in /usr/local/greenplum-db-6.13.0/bin
------------------------------------------------------------------------
checking for xml2-config... /usr/bin/xml2-config
checking libxml/tree.h usability... yes
checking libxml/tree.h presence... yes
checking for libxml/tree.h... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking libxml/xpath.h usability... yes
checking libxml/xpath.h presence... yes
checking for libxml/xpath.h... yes
checking libxml/xpathInternals.h usability... yes
checking libxml/xpathInternals.h presence... yes
checking for libxml/xpathInternals.h... yes
checking for xmlInitParser in -lxml2... yes
checking for geos-config... /usr/bin/geos-config
checking GEOS version... 3.4.2
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking for initGEOS in -lgeos_c... yes
checking for sfcgal-config... no
checking whether make sets $(MAKE)... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... /bin/sh: build-aux/config.rpath: No such file or directory
done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for proj_api.h... yes
checking for pj_get_release in -lproj... yes
checking json/json.h usability... yes
checking json/json.h presence... yes
checking for json/json.h... yes
checking for json_object_get in -ljson-c... yes
checking for PROTOBUFC... no
libprotobuf-c not found in pkg-config
checking protobuf-c/protobuf-c.h usability... no
checking protobuf-c/protobuf-c.h presence... no
checking for protobuf-c/protobuf-c.h... no
unable to find protobuf-c/protobuf-c.h using
checking for protobuf_c_message_init in -lprotobuf-c... no
unable to link protobuf-c using
checking for protobuf_c_version in -lprotobuf-c... no
checking protobuf-c version... 0
checking for protoc-c... no
Cannot find protoc-c protobuf compiler on the PATH: /usr/local/greenplum-db-6.13.0/bin:/usr/local/greenplum-db-6.13.0/ext/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
checking pcre.h usability... yes
checking pcre.h presence... yes
checking for pcre.h... yes
TOPOLOGY: Topology support disabled
RASTER: Raster support requested
checking for gdal-config... /usr/local/greenplum-db-6.13.0/bin/gdal-config
checking GDAL version... 1.11.1
checking for OGR enabled... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking ogr_api.h usability... yes
checking ogr_api.h presence... yes
checking for ogr_api.h... yes
checking cpl_conv.h usability... yes
checking cpl_conv.h presence... yes
checking for cpl_conv.h... yes
checking for library containing GDALAllRegister... none required
checking for library containing OGRRegisterAll... none required
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating extensions/Makefile
config.status: creating extensions/postgis/Makefile
config.status: creating extensions/postgis_sfcgal/Makefile
config.status: creating extensions/postgis_topology/Makefile
config.status: creating extensions/postgis_tiger_geocoder/Makefile
config.status: creating extensions/address_standardizer/Makefile
config.status: creating liblwgeom/Makefile
config.status: creating liblwgeom/cunit/Makefile
config.status: creating liblwgeom/liblwgeom.h
config.status: creating libpgcommon/Makefile
config.status: creating libpgcommon/cunit/Makefile
config.status: creating postgis/Makefile
config.status: creating postgis/sqldefines.h
config.status: creating loader/Makefile
config.status: creating loader/cunit/Makefile
config.status: creating topology/Makefile
config.status: creating topology/test/Makefile
config.status: creating regress/Makefile
config.status: creating doc/Makefile
config.status: creating doc/Makefile.comments
config.status: creating doc/html/image_src/Makefile
config.status: creating utils/Makefile
config.status: creating raster/Makefile
config.status: creating raster/rt_core/Makefile
config.status: creating raster/rt_pg/Makefile
config.status: creating raster/loader/Makefile
config.status: creating raster/test/Makefile
config.status: creating raster/test/cunit/Makefile
config.status: creating raster/test/regress/Makefile
config.status: creating raster/scripts/Makefile
config.status: creating raster/scripts/python/Makefile
config.status: creating postgis_config.h
config.status: creating raster/raster_config.h
config.status: executing libtool commands
config.status: executing po-directories commands

  PostGIS is now configured for x86_64-unknown-linux-gnu

 -------------- Compiler Info -------------
  C compiler:           gcc -g -O2
  SQL preprocessor:     /usr/bin/cpp -traditional-cpp -w -P

 -------------- Additional Info -------------
  Interrupt Tests:   DISABLED use: --with-interrupt-tests to enable

 -------------- Dependencies --------------
  GEOS config:          /usr/bin/geos-config
  GEOS version:         3.4.2
  GDAL config:          /usr/local/greenplum-db-6.13.0/bin/gdal-config
  GDAL version:         1.11.1
  PostgreSQL config:    /usr/local/greenplum-db-6.13.0/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.4.24
  PROJ4 version:        48
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.9.1
  JSON-C support:       yes
  protobuf-c support:   no
  PCRE support:         yes
  Perl:                 /usr/bin/perl

 --------------- Extensions ---------------
  PostGIS Raster:       enabled
  PostGIS Topology:     disabled
  SFCGAL support:       disabled
  Address Standardizer support:       enabled

 -------- Documentation Generation --------
  xsltproc:
  xsl style sheets:
  dblatex:
  convert:
  mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

configure: WARNING:  --------- GEOS VERSION WARNING ------------
configure: WARNING:   You are building against GEOS 3.4.2
configure: WARNING:   To take advantage of all the features of
configure: WARNING:   this PostGIS version requires GEOS 3.7.0 or higher.
configure: WARNING:   To take advantage of most of the features of this PostGIS
configure: WARNING:   we recommend GEOS 3.6 or higher
configure: WARNING:   You can download the latest versions from
configure: WARNING:   http://trac.osgeo.org/geos
configure: WARNING:

ERROR: query plan with multiple segworker groups is not supported when create extension postgis

Greenplum version or build

PostgreSQL 9.4.24 (Greenplum Database 6.13.0 build commit:4f1adf8e247a9685c19ea02bcaddfdc200937ecd Open Source) on x86_64-unknown-linux-gnu, compiled by
gcc (GCC) 6.4.0, 64-bit compiled on Dec 18 2020 22:31:16

OS version and uname -a

LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.9.2009 (Core)
Release: 7.9.2009
Codename: Core
Linux gyd-tc-app003 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

autoconf options used ( config.status --config )

Installation information ( pg_config )

BINDIR = /usr/local/greenplum-db-6.13.0/bin
DOCDIR = /usr/local/greenplum-db-6.13.0/share/doc/postgresql
HTMLDIR = /usr/local/greenplum-db-6.13.0/share/doc/postgresql
INCLUDEDIR = /usr/local/greenplum-db-6.13.0/include
PKGINCLUDEDIR = /usr/local/greenplum-db-6.13.0/include/postgresql
INCLUDEDIR-SERVER = /usr/local/greenplum-db-6.13.0/include/postgresql/server
LIBDIR = /usr/local/greenplum-db-6.13.0/lib
PKGLIBDIR = /usr/local/greenplum-db-6.13.0/lib/postgresql
LOCALEDIR = /usr/local/greenplum-db-6.13.0/share/locale
MANDIR = /usr/local/greenplum-db-6.13.0/man
SHAREDIR = /usr/local/greenplum-db-6.13.0/share/postgresql
SYSCONFDIR = /usr/local/greenplum-db-6.13.0/etc/postgresql
PGXS = /usr/local/greenplum-db-6.13.0/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-debug-extensions' '--disable-tap-tests' '--enable-orca' '--with-zstd' '--with-gssapi' '--with-libxml' '--with-perl' '--with-python' '--with-openssl' '--with-pam' '--with-ldap' '--with-extra-version= Open Source' '--prefix=/usr/local/greenplum-db-6.13.0' '--mandir=/usr/local/greenplum-db-6.13.0/man' 'CC=gcc' 'CFLAGS=-O3 -fargument-noalias-global -fno-omit-frame-pointer -g'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/greenplum-db-6.13.0/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fno-aggressive-loop-optimizations -Wno-unused-but-set-variable -Wno-address -O3 -fargument-noalias-global -fno-omit-frame-pointer -g -std=gnu99 -Werror=uninitialized -Werror=implicit-function-declaration -I/usr/local/greenplum-db-6.13.0/include
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/usr/local/greenplum-db-6.13.0/lib',--enable-new-dtags -L/usr/local/greenplum-db-6.13.0/lib
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxerces-c -lxml2 -lpam -lrt -lgssapi_krb5 -lzstd -lrt -lcrypt -ldl -lm -L/usr/local/greenplum-db-6.13.0/lib
VERSION = PostgreSQL 9.4.24

Expected behavior

Actual behavior

Step to reproduce the behavior

  1. compile and install postgis from (geospatial)[https://github.com/greenplum-db/geospatial],master branch
  2. psql
  3. postgres=# set optimizer=off;
  4. postgres=# CREATE EXTENSION postgis;
    ERROR: query plan with multiple segworker groups is not supported
    HINT: likely caused by a function that reads or modifies data in a distributed table

THD000,ERROR,""GPDB Expression type: Query Parameter not supported in DXL""

when create postgis extention ,i get some error:
[gpadmin@gpdb1 ~]$ psql -d postgres -c 'CREATE EXTENSION postgis;'
ERROR: function unnest(double precision[]) is not unique
LINE 1: SELECT COUNT(DISTINCT unnest)::float FROM unnest($1)
^
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
QUERY: SELECT COUNT(DISTINCT unnest)::float FROM unnest($1)
[gpadmin@gpdb1 ~]$

log:

2020-12-28 04:04:46.381781 EST,"gpadmin","postgres",p5742,th-1035675520,"[local]",,2020-12-28 04:04:46 EST,0,con21,cmd1,seg-1,,,,sx1,"LOG","00000","statement: CREATE EXTENSION postgis;",,,,,,"CREATE EXTENSION postgis;",0,,"postgres.c",1639,
2020-12-28 04:04:48.196177 EST,"gpadmin","postgres",p5742,th-1035675520,"[local]",,2020-12-28 04:04:46 EST,729,con21,cmd4,seg-1,,dx16,x729,sx1,"LOG","00000","2020-12-28 04:04:48:195958 EST,THD000,ERROR,""GPDB Expression type: Query Parameter not supported in DXL"",
",,,,,"SQL statement ""SELECT nsp != current_schema()""
PL/pgSQL function inline_code_block line 10 at IF","CREATE EXTENSION postgis;",0,,"COptTasks.cpp",281,
2020-12-28 04:04:48.648388 EST,"gpadmin","postgres",p5742,th-1035675520,"[local]",,2020-12-28 04:04:46 EST,729,con21,cmd4,seg-1,,dx16,x729,sx1,"ERROR","42725","function unnest(double precision[]) is not unique",,"Could not choose a best candidate function. You might need to add explicit type casts."," SELECT COUNT(DISTINCT unnest)::float FROM unnest($1) ",44,,"CREATE EXTENSION postgis;",0,,"parse_func.c",514,
2020-12-28 04:04:48.648472 EST,"gpadmin","postgres",p5742,th-1035675520,"[local]",,2020-12-28 04:04:46 EST,729,con21,cmd4,seg-1,,dx16,x729,sx1,"LOG","00000","An exception was encountered during the execution of statement: CREATE EXTENSION postgis;",,,,,,,0,,,,

PostGIS for Debian/Ubuntu

Hello!
I've developed a manual and a set of scripts for building PostGIS on the Debian platform. I'd be delighted if people could utilize my work within their GreenPlum clusters. I'm confident that many individuals use Debian and require the PostGIS extension in their GreenPlum clusters, despite it not being supported by default.

Please consider my work https://github.com/denismatveev/Greenplum_PostGIS_deb to be a part of your project or put my repository at the list of Greenplum repository.

I probably need to update some scripts since I created them more than 2 years ago. This is not a question for me. I can update the scripts to be compatible with the latest versions of GreenPlum and PostGIS that you have.
In case you have any questions I am happy to answer.

Thank you!

Fail to compile.

There are some problems during compiling the project.

rtpg_inout.c: In function ‘RASTER_recv’:
rtpg_inout.c:132:2: error: unknown type name ‘StringInfo’; did you mean ‘fmStringInfo’?
  StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
  ^~~~~~~~~~
  fmStringInfo
rtpg_inout.c:132:20: error: ‘StringInfo’ undeclared (first use in this function); did you mean ‘fmStringInfo’?
  StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
                    ^~~~~~~~~~
                    fmStringInfo
rtpg_inout.c:132:20: note: each undeclared identifier is reported only once for each function it appears in
rtpg_inout.c:138:43: error: invalid type argument of ‘->’ (have ‘int’)
  raster = rt_raster_from_wkb((uint8_t*)buf->data, buf->len);
                                           ^~
rtpg_inout.c:138:54: error: invalid type argument of ‘->’ (have ‘int’)
  raster = rt_raster_from_wkb((uint8_t*)buf->data, buf->len);
                                                      ^~
rtpg_inout.c:143:5: error: invalid type argument of ‘->’ (have ‘int’)
  buf->cursor = buf->len;
     ^~
rtpg_inout.c:143:19: error: invalid type argument of ‘->’ (have ‘int’)
  buf->cursor = buf->len;

Environment: gpdb7, centos7, gcc (GCC) 7.3.1

ST_Union 聚合函数不能够和postgresql的sum函数一样的效果

ST_Union 聚合函数并没有在segment上面将geometry数据聚合之后,再发送到master节点上面,之后由master节点Gather Motion

explain 结果如下:

postgres=# explain analyze  select st_union(geom) from world ;
                                                              QUERY PLAN                                                              
--------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=0.00..432.56 rows=1 width=8) (actual time=209.767..209.769 rows=1 loops=1)
   ->  Gather Motion 3:1  (slice1; segments: 3)  (cost=0.00..432.52 rows=1874 width=174) (actual time=2.431..4.154 rows=1874 loops=1)
         ->  Seq Scan on world  (cost=0.00..431.10 rows=625 width=174) (actual time=0.157..1.441 rows=626 loops=1)
 Planning Time: 10.708 ms
   (slice0)    Executor memory: 2554K bytes.
   (slice1)    Executor memory: 36K bytes avg x 3 workers, 36K bytes max (seg0).
 Memory used:  128000kB
 Optimizer: Pivotal Optimizer (GPORCA)
 Execution Time: 228.160 ms
(9 rows)

Just a Tip About libgeos_c.so.1

when i finished installing postgis ,i start run the command below:

psql -d mydatabase -f ${GPHOME}/share/postgresql/contrib/postgis-2.1/postgis.sql

but it goes wrong:

postgis-2.1.so": libgeos_c.so.1: cannot open shared object file: No such file or directory

so i run

ldd /opt/gpdb/lib/postgresql/postgis-2.1.so

here is the result

	linux-vdso.so.1 =>  (0x00007ffebadfe000)
	libgeos_c.so.1 => not found
	libproj.so.12 => not found
	libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fd9ce074000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd9cdcaa000)
	libgeos-3.5.0.so => /usr/local/geos/lib/libgeos-3.5.0.so (0x00007fd9cd8f9000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd9cd577000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd9cd361000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd9cd15d000)
	libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007fd9ccdc9000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd9ccbaf000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fd9cc98d000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd9cc684000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd9ce97d000)
	libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007fd9cabcd000)

so i copy the two files manually

sudo cp /usr/local/proj/lib/libproj.so.12   /opt/gpdb/lib
sudo cp /usr/local/geos/lib/libgeos_c.so.1  /opt/gpdb/lib

and finally it works

And i do all this in Ubuntu

regress error on 'SPI_palloc called while not connected to SPI (spi.c:1147)'

e.g sfcgal/tickets
in function getSRSbySRID at geospatial/postgis/build/postgis-2.5.4/postgis/lwgeom_export.c
I saw

    if (getSRSbySRIDbyRule(srid, short_crs, query) != NULL) {
        size = strlen(query) + 1;
        srscopy = SPI_palloc(size);
        memcpy(srscopy, query, size);
        return srscopy;
    }

    if (SPI_OK_CONNECT != SPI_connect ())
    {
        elog(NOTICE, "getSRSbySRID: could not connect to SPI manager");
        SPI_finish();
        return NULL;
    }

The key point is doing 'SPI_palloc' before 'SPI_connect' will raise an error 'SPI_palloc called while not connected to SPI'.
So I moved 'SPI_connect' before 'getSRSbySRIDbyRule' and add SPI_finish() before return srscopy, it can work.

greenplum has delete t_tableOid at 6.x in struct HeapTupleData

https://github.com/greenplum-db/gpdb/blob/c07c06f5572e9e2b362cfa126e383fa8fdb1274c/src/include/access/htup.h#L68

greenplum has delete t_tableOid at 6.x in struct HeapTupleData

https://github.com/greenplum-db/gpdb/blob/6.19.x/src/include/access/htup.h#L68

CDB: t_tableOid deleted. Instead, use tts_tableOid in TupleTableSlot

when compile with gp 6.x throw error:


mvt.c: In function ‘parse_values’:
mvt.c:646:7: error: ‘HeapTupleData {aka struct HeapTupleData}’ has no member named ‘t_tableOid’
  tuple.t_tableOid = InvalidOid;

configure file does not exist

Hello!

I'm trying to install, but there's no configure file...just a configure.ac

cd postgis/build/postgis-2.5.4/
./configure --with-pgconfig=$GPHOME/bin/pg_config --with-raster --without-topology --prefix=$GPHOME

-bash: ./configure: No such file or directory

Missing something??

Kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.