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 1tjNfB-009Gfv-Mj for pgsql-general@arkaria.postgresql.org; Sat, 15 Feb 2025 19:17:17 +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 1tjNfA-003MM3-BJ for pgsql-general@arkaria.postgresql.org; Sat, 15 Feb 2025 19:17:16 +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 1tjNfA-003MLv-0w for pgsql-general@lists.postgresql.org; Sat, 15 Feb 2025 19:17:16 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tjNf7-0011xX-2K for pgsql-general@lists.postgresql.org; Sat, 15 Feb 2025 19:17:15 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2fc33aef343so2825032a91.1 for ; Sat, 15 Feb 2025 11:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739647032; x=1740251832; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=n8rE8Rnqo0XdEQNlMkAne1HgYr9Pp1tP065qYZ0Uwcc=; b=Pkw0bipmbYDAGgII/hb9wjg2pMKf6FGu+RheAOYMbVm+utCWZZUgMwlZd0pKZrhpLv r1FWPBw23npU7PNkLzHsPs+1z9mysGKpwnA/yLILaZteQyhUEovWJOy8Y+pTajcB3jtm kcBzRoUAaCa452/bKF0Jsc4/fe96BlEV4ezp0WwhD0AKo6OjBRstavXJtqZI6f0812MD VjF3yhSzYhzSExQWW0T/XKTLuHz0U/KqBeje+pnyfWQu2TmZQLLLN7606zPDtssQcXNi zWkEakw3RJ8y59MXXnbg1XkppqQXxTB/U1j5kK55oi2DsmX15rcwo05wQ+5ZFgjRMRBN KZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739647032; x=1740251832; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n8rE8Rnqo0XdEQNlMkAne1HgYr9Pp1tP065qYZ0Uwcc=; b=l6Xxlin1oOKGVtUnvTDcU1cqdHEeRX81xMGY8zkV1QBCjHu34w79aGrV0+bB4swFyc 7GeCEFTJKT7sx7n7FP7qgunYViMnBBaOCcEJym/tpF6SG7KxmlyN8+APBRiIRitnqGq9 UTkhqFWZ8UtXrvlHuR6IpSTFzWp7ulFOYVmyL3HN1wWDJEJtaAvAkXrkwOF9t4Rr0DsA Qggvgtv36YBY+J3+B2jI3Us/Q9d2WYODHALIvqc6m2ClwC2uit5ArumFFam49Vu55PgH UkEAmbP/mtEwzIP2QpjMpKDc1HaVtYFSJYkKbIJIqiZ8Qw5DFlreuBwbLgPTYRKHznEH F7+Q== X-Gm-Message-State: AOJu0Yw46KZAF4kfnf1Nj2u45Kjt0mnLn6vvFmNG9XCDY/jVAEI38xqq 7cDVlFAScx6i0EZTDGYg3whPZUka+dX0n7btFyvg8LqNdWLXyrU0m2gBTRjVJYUJCI1519Ss+Pp d8nmhw0bHjt4l9iR3Ikz+R2OWZdjuRw== X-Gm-Gg: ASbGncv4647LQGCWom98UULWeyLfZDIJm+Xv7Vm4nQLJFRCIjVjiWsCWGvlY1ACYs5b rYj2CqZFFFd409hTCxFf+JnSsdoQEvhqdexnFWNEYWSkkgdZQkFc3T+VQ+tA7fTA2WKlH8yOYW8 a3HfKzZHcm5tjcF7EMWbHPBkJA/OUa2rk= X-Google-Smtp-Source: AGHT+IGZF/hC9DpF09eRY7YGs29z+SInwwUSZXnOF9Foh5ZtBsQHIk++7sniltwwRGO5xEdLjdCseS7Jn4uDeNh+w5w= X-Received: by 2002:a17:90b:4c44:b0:2ee:70cb:a500 with SMTP id 98e67ed59e1d1-2fc40d14e0dmr6261532a91.1.1739647031671; Sat, 15 Feb 2025 11:17:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yongye Serkfem Date: Sat, 15 Feb 2025 14:17:00 -0500 X-Gm-Features: AWEUYZnAJgPAi0AB-UqHL66XX94YE-6xnxYSPIg063g9CkLkaEl49YzoH3qI2ag Message-ID: Subject: Re: Bash profile To: Ron Johnson Cc: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000005b83c5062e3323f1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005b83c5062e3323f1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I am upgrading from version 12.7 to 15.7 On Sat, Feb 15, 2025, 2:15 PM Ron Johnson wrote: > On Sat, Feb 15, 2025 at 2:01=E2=80=AFPM 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. H= ow > 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=3D/Database/${1}/data ; } > > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster! > --0000000000005b83c5062e3323f1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I am upgrading from version 12.7 to 15.7


On Sat, Feb 15, 2025, 2:15 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Sat,= Feb 15, 2025 at 2:01=E2=80=AFPM Yongye Serkfem <yserkfem@gmail.com&= gt; wrote:
Hi Everyone!
I would a= ppreciate any assistance with configuring the bash profile to run two diffe= rent postgresql versions. Specifically V12.7 and 15.7

Create a bash function that exports PGDATA to the re= levant directory, based on the parameter you pass.
Add as much er= ror checking (to ensure that the parameter you passed actually points to a = real data dir and that the postmaster is running.=C2=A0 How you do that dep= ends on whether it's Debian-based, RH-based or something else.

We, for=C2=A0example, have standardized on data directorie= s in the format:
/Database/<MajorVer>/data

Thus, something as simple as this would work for us:
pgs= witch() { export PGDATA=3D/Database/${1}/data ; }

--
Death to <Redacted>, and butte= r sauce.
Don't boil me, I'm still alive.
<Redac= ted> lobster!
--0000000000005b83c5062e3323f1--