Why Hard-Coded Version 9.1 In Names?

Started by Jerry Richardsabout 14 years ago5 messagesgeneral
Jump to latest
#1Jerry Richards
jerry.richards@teotech.com

I just installed postgreSQL 9.1 and noticed it hard-codes the folder /var/lib/pgsql/9.1 and it hard-codes the service name to be postgresql91. My previous version of 8.4.4 uses the generic folder /var/lib/pgsql/data and the generic service name postgresql. This causes a problem for me because I have a lot of tools and software that uses the old path and name.

Why is the hard-coded version included in the naming? Is there some install method to keep it using the generic names?

Thanks,
Jerry

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Jerry Richards (#1)
Re: Why Hard-Coded Version 9.1 In Names?

On Mon, Jan 30, 2012 at 3:41 PM, Jerry Richards
<jerry.richards@teotech.com> wrote:

I just installed postgreSQL 9.1 and noticed it hard-codes the folder
/var/lib/pgsql/9.1 and it hard-codes the service name to be postgresql91.
My previous version of 8.4.4 uses the generic folder /var/lib/pgsql/data and
the generic service name postgresql.  This causes a problem for me because I
have a lot of tools and software that uses the old path and name.

Why is the hard-coded version included in the naming?  Is there some install
method to keep it using the generic names?

It's to allow > 1 version to be installed at once.

#3Marti Raudsepp
marti@juffo.org
In reply to: Jerry Richards (#1)
Re: Why Hard-Coded Version 9.1 In Names?

On Tue, Jan 31, 2012 at 00:41, Jerry Richards
<jerry.richards@teotech.com> wrote:

I just installed postgreSQL 9.1 and noticed it hard-codes the folder
/var/lib/pgsql/9.1 and it hard-codes the service name to be postgresql91.

Why is the hard-coded version included in the naming?

Note that this is done by Linux distributions, vanilla PostgreSQL
doesn't use version-specific paths.

The reason is that the PostgreSQL on-disk format is not
forward-compatible. In order to upgrade from one Postgres version to
the next, you need to have *both* versions installed at once. As
annoying as it is, version-specific paths is a pretty foolproof way to
enable that.

Regards,
Marti

#4Bobby Dewitt
Bdewitt@appriss.com
In reply to: Marti Raudsepp (#3)
Re: Why Hard-Coded Version 9.1 In Names?

We get around this issue by creating a symbolic link called "current" that
points to the version of Postgres that we want our servers to use by
default:

ln -s /var/lib/pgsql/9.1 /var/lib/pgsql/current

The symbolic link is changed whenever we do an upgrade so it doesn't
interfere with anything that we may already have configured.

Thanks,
Bobby

On 1/31/12 8:14 AM, "Marti Raudsepp" <marti@juffo.org> wrote:

Show quoted text

On Tue, Jan 31, 2012 at 00:41, Jerry Richards
<jerry.richards@teotech.com> wrote:

I just installed postgreSQL 9.1 and noticed it hard-codes the folder
/var/lib/pgsql/9.1 and it hard-codes the service name to be
postgresql91.

Why is the hard-coded version included in the naming?

Note that this is done by Linux distributions, vanilla PostgreSQL
doesn't use version-specific paths.

The reason is that the PostgreSQL on-disk format is not
forward-compatible. In order to upgrade from one Postgres version to
the next, you need to have *both* versions installed at once. As
annoying as it is, version-specific paths is a pretty foolproof way to
enable that.

Regards,
Marti

#5Grzegorz Jaśkiewicz
gryzman@gmail.com
In reply to: Bobby Dewitt (#4)
Re: Why Hard-Coded Version 9.1 In Names?

Its because of pg_upgrade, 'in place' upgrade capabilities that are in
pg since 8.4. For that to work you need both old and new (current) set
of postgresql binaries. Etc.