Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1inlFQ-0008DM-LS for pgsql-general@arkaria.postgresql.org; Sat, 04 Jan 2020 15:21:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1inlEP-0002Js-PL for pgsql-general@arkaria.postgresql.org; Sat, 04 Jan 2020 15:20:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1inlEP-0002Jl-Ek for pgsql-general@lists.postgresql.org; Sat, 04 Jan 2020 15:20:49 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1inlEN-0006PK-4x for pgsql-general@lists.postgresql.org; Sat, 04 Jan 2020 15:20:49 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 0BE27262FB8 for ; Sat, 4 Jan 2020 07:20:44 -0800 (PST) Date: Sat, 4 Jan 2020 07:20:44 -0800 (PST) From: Rich Shepard Reply-To: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Changing default ../data/ directory Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I run Slackware (currently -14.2/x86_64) and postgres-11.5. The data directory has always been located in /var/lib/pgsql//data. This data directory is located in the / partition on a 240G SSD. There's another 2T HDD with a /data partition and I want to both move the current /var/lib/pgsql/data cluster to /data/pgsql/11 and have all future databases use that location. The PGDATA environment variable used to be used for this (but I never did get it satisfactorily working). Web searches show changing initdb or, perhaps, postgresql.conf (there is a /usr/share/postgresql.conf.sample but no postgresql.conf). As this is all new to me I want to learn how to: 1) Define a postgresl.conf and learn where it should be located. 2) Move all current databased in /var/lib/pgsql/11/data to /data/pgsql/11. 3) Create all new databases in /data/pgsql/11 by default. I'm sure it's in the manual yet I'm unsure just where to start reading. Rich