Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjPPz-009b2B-Lg for pgsql-general@arkaria.postgresql.org; Sat, 15 Feb 2025 21:09:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tjPPy-004E9P-9b for pgsql-general@arkaria.postgresql.org; Sat, 15 Feb 2025 21:09:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjPPx-004E9H-DI for pgsql-general@lists.postgresql.org; Sat, 15 Feb 2025 21:09:41 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tjPPu-0012tE-1G for pgsql-general@lists.postgresql.org; Sat, 15 Feb 2025 21:09:41 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1331B2540149; Sat, 15 Feb 2025 16:09:37 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 15 Feb 2025 16:09:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1739653776; x=1739740176; bh=Tc3yXaz+KpyBbEWscrNb0Snn3srUtDdsSrOEIUbIE+0=; b= Wxzfko6QZTUxrmIrIKjaYJlFQY4K1zyhVSVkksi1xgYEAXnMDlPIYZoIsixZ+pPM AimKoDsBYnbXLZRmAxTpAvWnZznz4q1eR9rFM/QhKfNG/m4IwFME0iE4OU4YYJP+ 2v3YjO7KcRk8gCzvd2txrsFGIe0RZIl9ZAl+8e2/a/aDN0etg38RsYVkiVkJ/hHx +yAVXwzLnf7iGg+lGH+HiDDcXLZRDRbsNHnX/ZNBnH+kG1dYnQFACsC///oA9l6Z rp9LqK66Hr9Xrb8EwM526piQut/PBKbBkcIavoBtNoqtl2eHmHDRD0ui4K5hrylv u82YNvVAJS14kRKIFT25aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1739653776; x= 1739740176; bh=Tc3yXaz+KpyBbEWscrNb0Snn3srUtDdsSrOEIUbIE+0=; b=u Cdy5+8VKZpFzlYPqubxwi/EzU8vjNclKfXcZNpKSs4bpbtNV3ijWO8eMkcaFU8yz UFVpZPxcI6K+9Smnkzj0uDyeqSQs5g5F3rbJ3iPDaKQmQYlpM6OcJ8R8y6heLJnh 5wSyb7i958Pz8ZQ4fxTIGZMJcenPVeS8otyh65DImEhOZCSBhf/Yh2P9MOZRpbH9 bk9ykTtHwux3xs+1ld0NrzgYmCDMkCcg1wJR+HQmdcsT6bw42tmi0CSW9pA7G5Rt j6hi80LAeL3LJIxbO0F1NqakwDS5fHeRHtCIHSHuWQ0Li+NRVSxGBqmVM5wJui3G Bbh2qT9bRhZErFX1zBnbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehfeehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeefgeefieeutdfggfet gefgheekjeehteeileeigfetieekjedvieeviefgheevtdenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegr khhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopeihshgvrhhkfhgvmhesghhmrghilhdrtghomhdprhgtphhtthhopehr ohhnlhhjohhhnhhsohhnjhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlh dqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 15 Feb 2025 16:09:36 -0500 (EST) Message-ID: Date: Sat, 15 Feb 2025 13:09:35 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Bash profile To: Yongye Serkfem , Ron Johnson Cc: "pgsql-generallists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/15/25 11:17, Yongye Serkfem wrote: > I am upgrading from version 12.7 to 15.7 You are going to have to explain what, in your situation, BASH has to do with the upgrade process. Generally migrations depend on Postgres programs and are not shell specific. > > > On Sat, Feb 15, 2025, 2:15 PM Ron Johnson > wrote: > > On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem > wrote: > > Hi Everyone! > I would appreciate any assistance with configuring the bash > profile to run two different postgresql versions. Specifically > V12.7 and 15.7 > > > Create a bash function that exports PGDATA to the relevant > directory, based on the parameter you pass. > Add as much error checking (to ensure that the parameter you passed > actually points to a real data dir and that the postmaster is > running.  How you do that depends on whether it's Debian-based, > RH-based or something else. > > We, for example, have standardized on data directories in the format: > /Database//data > > Thus, something as simple as this would work for us: > pgswitch() { export PGDATA=/Database/${1}/data ; } > > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster! > -- Adrian Klaver adrian.klaver@aklaver.com