software:postgresql11 [PaleoEarthLabs wiki]

PaleoEarthLabs wiki

One bucket of limited wisdom

Site Tools


software:postgresql11

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:postgresql11 [2019/06/17 06:42]
christian created
software:postgresql11 [2019/12/27 18:08] (current)
christian
Line 1: Line 1:
 ====== PostgreSQL & PostGIS ====== ====== PostgreSQL & PostGIS ======
  
-Installing/​upgrading to [[https://​www.postgresql.org]] version 11.and [[http://​postgis.net|PostGIS]] version 2.5.on Mac OS X/MacOS Sierra (v10.12).+Installing/​upgrading to [[https://​www.postgresql.org|PostgreSQL]] version 11.and [[http://​postgis.net|PostGIS]] version 2.5.on Mac OS X/MacOS Sierra (v10.12)/High Sierra.
  
 <note important>​This note is in draft stage and currently just a dump of snippets</​note>​ <note important>​This note is in draft stage and currently just a dump of snippets</​note>​
Line 7: Line 7:
 The reason for a manual installation is that I want to utilise the GDAL framework utilised by QGIS and GMT. This setup naturally collides with Homebrew'​s setup to install GDAL as part of the dependency framework when installing postgis. The reason for a manual installation is that I want to utilise the GDAL framework utilised by QGIS and GMT. This setup naturally collides with Homebrew'​s setup to install GDAL as part of the dependency framework when installing postgis.
  
 +I also use the [[https://​www.python.org|Python.org'​s Python Frameworks]].
  
 ===== Preparation ===== ===== Preparation =====
  
  
-So I am leaving the dependencies to homebrew apart from GDAL.+So I am leaving the dependencies to homebrew apart from GDAL and Python.
  
  
 ===== PostgreSQL ===== ===== PostgreSQL =====
 +
 +The documentation to compile from source is available [[https://​www.postgresql.org/​docs/​11/​install-requirements.html|on the Postgresql.org website]]
 +
  
 <​code>​ <​code>​
-./configure --with-perl --with-uuid=e2fs --with-python --with-libxml ​ --with-readline --with-bonjour --prefix=/​usr/​local/​pgsql/​11.3/ --with-libraries=/​usr/​local/​Cellar/​readline/​7.0.5/:/​usr/​local/​Cellar/​ossp-uuid/​1.6.2_2/:/​Library/​Frameworks/​Python.framework/​+./configure --with-perl --with-uuid=e2fs --with-python --with-libxml ​ --with-readline ​\\ 
 +    ​--with-bonjour --prefix=/​usr/​local/​pgsql/​11.x\\ 
 +    ​--with-libraries=/​usr/​local/​Cellar/​readline/​x.x.x/:/​usr/​local/​Cellar/​ossp-uuid/​x.x.x/:/​Library/​Frameworks/​Python.framework/​
 </​code>​ </​code>​
 +
 +
 +After an upgrade of the OS it seems that the LaunchDaemon is broken.
 +
 +On their [[http://​opensource.apple.com|OpenSource pages]] Apple provides a template for one of the [[https://​opensource.apple.com/​source/​PostgreSQL/​PostgreSQL-23/​|older included PostgreSQL versions (here: 9.0.4)]]. This deviates a bit from what I used previously for the LaunchDaemon file.
 +
 +Verbatim copy of [[https://​opensource.apple.com/​source/​PostgreSQL/​PostgreSQL-23/​org.postgresql.postgres.plist.auto.html|org.postgresql.postgres.plist]]:​
 +
 +<file org.postgresql.postgres.plist>​
 +<?xml version="​1.0"​ encoding="​UTF-8"?>​
 +<​!DOCTYPE plist PUBLIC "​-//​Apple Computer//​DTD PLIST 1.0//​EN"​ "​http://​www.apple.com/​DTDs/​PropertyList-1.0.dtd">​
 +<plist version="​1.0">​
 +<​dict>​
 + <​key>​Disabled</​key>​
 + <​true/>​
 + <​key>​Label</​key>​
 + <​string>​org.postgresql.postgres</​string>​
 + <​key>​UserName</​key>​
 + <​string>​_postgres</​string>​
 + <​key>​GroupName</​key>​
 + <​string>​_postgres</​string>​
 + <​key>​ProgramArguments</​key>​
 + <​array>​
 + <​string>/​usr/​bin/​postgres</​string>​
 + <​string>​-D</​string>​
 + <​string>/​var/​pgsql</​string>​
 + <​string>​-c</​string>​
 + <​string>​unix_socket_directory=/​var/​pgsql_socket</​string>​
 + <​string>​-c</​string>​
 + <​string>​logging_collector=on</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_connections=on</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_lock_waits=on</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_statement=ddl</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_line_prefix=%t </​string>​
 + <​string>​-c</​string>​
 + <​string>​listen_addresses=</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_directory=/​Library/​Logs</​string>​
 + <​string>​-c</​string>​
 + <​string>​log_filename=PostgreSQL.log</​string>​
 + <​string>​-c</​string>​
 + <​string>​unix_socket_group=_postgres</​string>​
 + <​string>​-c</​string>​
 + <​string>​unix_socket_permissions=0770</​string>​
 + </​array>​
 + <​key>​OnDemand</​key>​
 + <​false/>​
 +</​dict>​
 +</​plist>​
 +</​file>​
 +
 +Homebrew'​s distro uses a slightly different version - here's the excerpt from the [[https://​github.com/​Homebrew/​homebrew-core/​blob/​master/​Formula/​postgresql@11.rb|postgresql.rb]] file:
 +
 +<code ruby>
 +  def plist; <<​~EOS
 +    <?xml version="​1.0"​ encoding="​UTF-8"?>​
 +    <​!DOCTYPE plist PUBLIC "​-//​Apple//​DTD PLIST 1.0//​EN"​ "​http://​www.apple.com/​DTDs/​PropertyList-1.0.dtd">​
 +    <plist version="​1.0">​
 +    <​dict>​
 +      <​key>​KeepAlive</​key>​
 +      <​true/>​
 +      <​key>​Label</​key>​
 +      <​string>#​{plist_name}</​string>​
 +      <​key>​ProgramArguments</​key>​
 +      <​array>​
 +        <​string>#​{opt_bin}/​postgres</​string>​
 +        <​string>​-D</​string>​
 +        <​string>#​{var}/#​{name}</​string>​
 +      </​array>​
 +      <​key>​RunAtLoad</​key>​
 +      <​true/>​
 +      <​key>​WorkingDirectory</​key>​
 +      <​string>#​{HOMEBREW_PREFIX}</​string>​
 +      <​key>​StandardOutPath</​key>​
 +      <​string>#​{var}/​log/#​{name}.log</​string>​
 +      <​key>​StandardErrorPath</​key>​
 +      <​string>#​{var}/​log/#​{name}.log</​string>​
 +    </​dict>​
 +    </​plist>​
 +  EOS
 +  end
 +</​code>​
 +
  
  
Line 24: Line 117:
  
 <​code>​ <​code>​
- ​./​configure --prefix=/​usr/​local/​pgsql/​11.3/ --with-projdir=/​Library/​Frameworks/​PROJ.framework/​unix/​ --with-raster --with-topology --with-pgconfig=/​usr/​local/​pgsql/​11.3/​bin/​pg_config --with-geosconfig=/​Library/​Frameworks/​GEOS.framework/​unix/​bin/​geos-config ​+ ​./​configure --prefix=/​usr/​local/​pgsql/​11.x/ --with-projdir=/​Library/​Frameworks/​PROJ.framework/​unix/​ --with-raster --with-topology --with-pgconfig=/​usr/​local/​pgsql/​11.x/​bin/​pg_config --with-geosconfig=/​Library/​Frameworks/​GEOS.framework/​unix/​bin/​geos-config ​
 </​code>​ </​code>​
  
 {{tag>​GIS Database MacOS PostGIS PostgreSQL compilation software}} {{tag>​GIS Database MacOS PostGIS PostgreSQL compilation software}}
software/postgresql11.1560746574.txt.gz · Last modified: 2019/06/17 06:42 by christian