# PostGIS support?

**URL:** <https://forum.yugabyte.com/t/postgis-support/709>\
**Category:** General\
**Created:** [May 18, 2020, 12:57pm UTC](https://forum.yugabyte.com/t/postgis-support/709 "2020-05-18T12:57:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zopyx](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/zopyx/32/149_2.png) [@zopyx](https://forum.yugabyte.com/u/zopyx)\
**Post date:** [May 18, 2020, 12:57pm UTC](https://forum.yugabyte.com/t/postgis-support/709/1 "2020-05-18T12:57:20Z")

</div>

We are currently working on a tender where one core component is a Postgres installation running PostGIS. I wonder if there is some experience with running PostGIS in the context of Yugabyte. Anyone tried that out?

Andreas

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [May 18, 2020, 6:51pm UTC](https://forum.yugabyte.com/t/postgis-support/709/2 "2020-05-18T18:51:52Z")

</div>

Hi @zopyx

Yes we support Postgis and some: [PostgreSQL extensions | YugabyteDB Docs](https://docs.yugabyte.com/latest/api/ysql/extensions/#postgis)

Many extensions should work out of the box except:

1. Any extension that touches the storage layer will not work (or not correctly).
2. Extensions that only touch the query layer should _typically work_ but may not work correctly or the same as in Postgres.
3. For instance, extensions that implicitly rely on some global state (e.g. statistics extensions) will only gather/report per-node information. That may be good for some extensions/use-cases but not for others.
4. Additionally, some extensions may require unsupported query-layer features (like GiST or GIN indexes, deferred constraints, table inheritance, etc). These may partly work or not even run/install.

In PostGIS, to speedup queries you usually add GiST indexes, which aren’t currently supported but [on the roadmap](https://github.com/yugabyte/yugabyte-db/issues/1337).

---

<div class="post-metadata">

**Author:** ![becks](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@becks](https://forum.yugabyte.com/u/becks)\
**Post date:** [July 27, 2021, 8:39am UTC](https://forum.yugabyte.com/t/postgis-support/709/3 "2021-07-27T08:39:24Z")

</div>

Hi i tried the link. I able to ingest geomtry data such as point(0,0).  
CREATE TABLE ROADS (road\_id serial, road\_name text, roads\_geom geometry );  
INSERT INTO roads (road\_id, road\_name, roads\_geom) VALUES (1,‘test’,‘POINT(0 1)’);  
SELECT \* from roads where ST\_Equals(roads\_geom, ST\_GeomFromText(‘POINT(0 1)’,64));

I perform the above select statement but i got an error below:  
server closed the connection unexpectedly  
This probably means the server terminated abnormally  
before or while processing the request.  
The connection to the server was lost. Attempting reset: Failed.

I can’t query anything that is geometry field type.

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [July 27, 2021, 10:20am UTC](https://forum.yugabyte.com/t/postgis-support/709/4 "2021-07-27T10:20:57Z")

</div>

Hi @becks  
What version are you using ?  
Can you paste some logs from yb-tserver & postgresql ? ([how to get logs](https://docs.yugabyte.com/latest/troubleshoot/nodes/check-logs/)). Can you create a [new github issue](https://github.com/yugabyte/yugabyte-db/issues) for this ?

---

<div class="post-metadata">

**Author:** ![becks](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@becks](https://forum.yugabyte.com/u/becks)\
**Post date:** [July 27, 2021, 1:40pm UTC](https://forum.yugabyte.com/t/postgis-support/709/5 "2021-07-27T13:40:28Z")

</div>

ok posted

> <https://github.com/yugabyte/yugabyte-db/issues/9478>
>
> \`\`\`
> FROM yugabytedb/yugabyte:2.7.1.1-b1
> 
> RUN rpm -Uvh https://download.postgr…esql.org/pub/repos/yum/reporpms/EL-7-x86\_64/pgdg-redhat-repo-latest.noarch.rpm
> RUN yum update -y
> RUN yum install -y postgresql11-server postgis31\_11
> 
> RUN cp -v "$(/usr/pgsql-11/bin/pg\_config --pkglibdir)"/\*postgis\*.so "$(/home/yugabyte/postgres/bin/pg\_config --pkglibdir)"
> RUN cp -v "$(/usr/pgsql-11/bin/pg\_config --sharedir)"/extension/\*postgis\*.sql "$(/home/yugabyte/postgres/bin/pg\_config --sharedir)"/extension
> RUN cp -v "$(/usr/pgsql-11/bin/pg\_config --sharedir)"/extension/\*postgis\*.control "$(/home/yugabyte/postgres/bin/pg\_config --sharedir)"/extension
> 
> RUN /home/yugabyte/bin/post\_install.sh -e
> \`\`\`
> 
> Below are the sql
> 
> \`\`\`
> CREATE EXTENSION postgis;
> \`\`\`
> \`\`\`
> CREATE TABLE roads (road\_id serial, road\_name text, roads\_geom geometry)
> \`\`\`
> \`\`\`
> INSERT INTO roads (road\_id, road\_name, roads\_geom) VALUES (1,‘test’,‘POINT(0 1)’);
> \`\`\`
> \`\`\`
> SELECT \* from roads where ST\_Equals(roads\_geom, ST\_GeomFromText(‘POINT(0 1)’,64));
> \`\`\`
> 
> I got an error
> 
> \> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> 
> Error logs from tserver
> 
> \> 2021-07-27 13:38:26.039 UTC \[46\] LOG: server process (PID 445) was terminated by signal 11: Segmentation fault
> 2021-07-27 13:38:26.039 UTC \[46\] DETAIL: Failed process was running: select \* from roads where ST\_Equals(roads\_geom, ST\_GeomFromText('POINT(0 0)',64));
> 2021-07-27 13:38:26.039 UTC \[46\] LOG: terminating any other active server processes
> 2021-07-27 13:38:26.040 UTC \[455\] FATAL: the database system is in recovery mode
> 2021-07-27 13:38:26.045 UTC \[46\] LOG: all server processes terminated; reinitializing
> 2021-07-27 13:38:26.065 UTC \[456\] LOG: database system was interrupted; last known up at 2021-07-27 13:36:13 UTC
> 2021-07-27 13:38:26.097 UTC \[456\] LOG: database system was not properly shut down; automatic recovery in progress
> 2021-07-27 13:38:26.101 UTC \[456\] LOG: invalid record length at 0/10002C8: wanted 24, got 0
> 2021-07-27 13:38:26.101 UTC \[456\] LOG: redo is not required
> 2021-07-27 13:38:26.134 UTC \[46\] LOG: database system is ready to accept connections
> 
> Is there any wrong with my sql statment? Thanks
