From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0IBpO/+KoF/vQgAA0tVLHw (envelope-from ) for ; Mon, 02 Nov 2020 22:41:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YO1rN/+KoF98ZgAAB5/wlQ (envelope-from ) for ; Mon, 02 Nov 2020 22:41:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2AFCD9401BC for ; Mon, 2 Nov 2020 22:41:03 +0000 (UTC) Received: from localhost ([::1]:44730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZiVa-0007SF-4F for larch@yhetil.org; Mon, 02 Nov 2020 17:41:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZiVD-0007PT-4z for help-guix@gnu.org; Mon, 02 Nov 2020 17:40:39 -0500 Received: from knopi.disroot.org ([178.21.23.139]:41266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZiV9-0004mX-IC for help-guix@gnu.org; Mon, 02 Nov 2020 17:40:38 -0500 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 924BE537B9 for ; Mon, 2 Nov 2020 23:40:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eKmphDydb_Ci for ; Mon, 2 Nov 2020 23:40:29 +0100 (CET) From: Gary Johnson DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1604356827; bh=+d217thGplYMozXLcH5fExN+4ersn8xMlvj6xQmtFC8=; h=From:To:Subject:Date; b=ZZNURu45AdNyw3VaylfGKOXDPxKuN6ebRGbhOwNLOCv086P7l6nJKblTuXJcLW2vt jCkPMhkG0oNe9eR7AZZhMF20FZUGRSyGn38InSmJ6e3ZDe0WUn03swFKMZ8JKMoBz4 8s1F4Sxw4o13U5Z8CHJl8K+HM+d+9YXOb1+2o7fUHJP/FearQAVyDv6yWxPzAzpoF9 ppl9K030kZuU2SlGUoGhEiT7V7cleKh4TajwAaWGN2eEUBAoNosvcnwjuvg6RhM9rJ ZJXXkJ6VI5HQPbmS4y9oGW6OlLMVlG5Anh8AzuogQQvnl+nPmgAw1ekSFocJEcjRJ3 +0JyrwmPI1P/w== To: help-guix Subject: How do I correctly relocate PostGIS control files? Date: Mon, 02 Nov 2020 17:40:09 -0500 Message-ID: <87y2jjgz7a.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=178.21.23.139; envelope-from=lambdatronic@disroot.org; helo=knopi.disroot.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/02 17:40:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=ZZNURu45; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: O0ItRIBKLY4v Hi Guix, I use Postgresql with PostGIS extensively for geospatial software development. While the default set of postgresql (v10.13) and postgis (v3.0.2) packages in Guix have worked well for me for some time, I am now in need of upgrading to the latest version in order to utilize newer functionality in the database software. To do this, I created a derivative package for postgresql (v13.0) as well as a derivative postgis package that uses the new postgresql package as an input. These packages compile and install correctly with "guix package -i". Here's my code: ;;============================================================================================================================= (define-module (my-packages postgresql-13) #:use-module ((guix packages) #:select (package origin base32)) #:use-module ((guix download) #:select (url-fetch)) #:use-module ((gnu packages databases) #:select (postgresql)) #:use-module ((gnu packages geo) #:select (postgis gdal geos proj)) #:use-module ((gnu packages image) #:select (giflib)) #:use-module ((gnu packages web) #:select (json-c)) #:use-module ((gnu packages image) #:select (libjpeg-turbo)) #:use-module ((gnu packages xml) #:select (libxml2)) #:use-module ((gnu packages pcre) #:select (pcre))) (define-public postgresql-13 (package (inherit postgresql) (name "postgresql") (version "13.0") (source (origin (method url-fetch) (uri (string-append "https://ftp.postgresql.org/pub/source/v" version "/postgresql-" version ".tar.bz2")) (sha256 (base32 "15i2b7m9a9430idqdgvrcyx66cpxz0v2d81nfqcm8ss3inz51rw0")))))) (define-public postgis-for-postgresql-13 (package (inherit postgis) (name "postgis") (version "3.0.2") (inputs `(("gdal" ,gdal) ("geos" ,geos) ("giflib" ,giflib) ("json-c" ,json-c) ("libjpeg" ,libjpeg-turbo) ("libxml2" ,libxml2) ("pcre" ,pcre) ("postgresql" ,postgresql-13) ("proj" ,proj))))) ;;============================================================================================================================= Next, I moved to my OS config.scm file to set up the Postgresql Shepherd service and add PostGIS as an extension package for the DB, which should make its control files available to Postgresql at runtime. Here are the relevant sections: ;;============================================================================================================================= (use-modules ... ((gnu services databases) #:select (postgresql-service-type postgresql-configuration postgresql-config-file)) ((my-packages postgresql-13) #:select (postgresql-13 postgis-for-postgresql-13))) (operating-system ... (packages (cons* ... postgresql-13 postgis-for-postgresql-13 ; psql, raster2pgsql, shp2pgsql, etc. %base-packages)) (services (cons* ... (service postgresql-service-type (postgresql-configuration (postgresql postgresql-13) (extension-packages (list postgis-for-postgresql-13)) (config-file (postgresql-config-file (hba-file my-postgres-hba) (extra-config '(("max_worker_processes" "12") ("max_parallel_workers" "40") ("max_parallel_maintenance_workers" "8") ("max_parallel_workers_per_gather" "4") ("parallel_leader_participation" "on"))))))) %desktop-services))) ;;============================================================================================================================= This compiles and installs successfully with "guix system reconfigure". However, when I connect to the Postgresql server with "psql -U postgres" and attempt to add the PostGIS extension to a database, I get the dreaded "could not open extension control file" error: ;;============================================================================================================================= db=# create extension postgis; ERROR: could not open extension control file "/gnu/store/8m48v5132qpmxim9s4g9vca59qgay2d9-postgresql-13.0/share/extension/postgis.control": No such file or directory ;;============================================================================================================================= This error does not occur when using the stock postgresql (v10.13) and postgis (v3.0.2) packages that come with the current Guix, so something is going wrong with the "extension-packages" code from my config.scm's "postgresql-configuration" record. I am very much hoping that one of the Guix maintainers can look into this and help me resolve the issue as I suspect it may be affecting any user that wants to use a different version of Postgres. Thanks in advance, Gary -- GPG Key ID: 7BC158ED Use `gpg --search-keys lambdatronic' to find me Protect yourself from surveillance: https://emailselfdefense.fsf.org ======================================================================= () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments Please avoid sending me MS-Office attachments. See http://www.gnu.org/philosophy/no-word-attachments.html