Bash profile

Started by Yongye Serkfemabout 1 year ago6 messagesgeneral
Jump to latest
#1Yongye Serkfem
yserkfem@gmail.com

Hi Everyone!
I would appreciate any assistance with configuring the bash profile to run
two different postgresql versions. Specifically V12.7 and 15.7

My regards to all
Yongye Serkfem.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Yongye Serkfem (#1)
Re: Bash profile

On Sat, Feb 15, 2025 at 12:01 PM Yongye Serkfem <yserkfem@gmail.com> wrote:

I would appreciate any assistance with configuring the bash profile to run
two different postgresql versions. Specifically V12.7 and 15.7

Can you provide more detail on what you are trying to do, and why? Your
request doesn't make sense as stated.

David J.

#3Ron
ronljohnsonjr@gmail.com
In reply to: Yongye Serkfem (#1)
Re: Bash profile

On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem <yserkfem@gmail.com> 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/<MajorVer>/data

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

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

#4Yongye Serkfem
yserkfem@gmail.com
In reply to: Ron (#3)
Re: Bash profile

I am upgrading from version 12.7 to 15.7

On Sat, Feb 15, 2025, 2:15 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:

Show quoted text

On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem <yserkfem@gmail.com> 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/<MajorVer>/data

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

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

#5Ron
ronljohnsonjr@gmail.com
In reply to: Yongye Serkfem (#4)
Re: Bash profile

So?

Honestly, your question has zero to do with Postgresql. Its basic Linux
configuration.

Before the migration, PGDATA and PATH should point to the v12 "stuff", and
after the migration they should point to the v15 "stuff". It's that simple.

On Sat, Feb 15, 2025 at 2:17 PM Yongye Serkfem <yserkfem@gmail.com> wrote:

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 PM Yongye Serkfem <yserkfem@gmail.com>
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/<MajorVer>/data

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

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

#6Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Yongye Serkfem (#4)
Re: Bash profile

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 <ronljohnsonjr@gmail.com
<mailto:ronljohnsonjr@gmail.com>> wrote:

On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem <yserkfem@gmail.com
<mailto:yserkfem@gmail.com>> 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/<MajorVer>/data

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

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

--
Adrian Klaver
adrian.klaver@aklaver.com