Re: Default UID for postgres user in linux - Mailing list pgsql-admin

From Steve Crawford
Subject Re: Default UID for postgres user in linux
Date
Msg-id 534D9BEA.5090608@pinpointresearch.com
Whole thread Raw
In response to Re: Default UID for postgres user in linux  (Rama Krishnan <ramky25@gmail.com>)
List pgsql-admin
On 04/14/2014 09:18 PM, Rama Krishnan wrote:
> Thanks all,
>
> Actually I am trying to setup a postgres failover using common setup.
>
> I.e,
> A postgres data directory is stored in central location.
> Two postgres uses the same location
> If One postgres down and the other will start....
>
> The problem is, If the postgres users in the two machines has
> different UID's then i need to change ownership of data directory
> every time -- which takes long time
> If din't change ownership of data directory then i am getting access
> denied errors ..
>
> So if the both users have same UID's then there is no issue.
>
>
The postgres user is what most distros install but PostgreSQL can run
under pretty much any user. You will have to use care in how you install
(everything from the same base image, for instance) or do some
after-install tweaking of UIDs to make sure they match on all machines.

But...

I think you should explain your reasoning, setup and use-case more fully
to get ideas from the community. In most cases the part most likely to
fail or get corrupted is the storage - far more likely than the
CPU/RAM/etc.. It seems that your setup has the storage as a single point
of failure.

Unless you are very careful, you risk the possibility of both PostgreSQL
servers trying to connect to the same storage which will not end well.

You will also need to be sure to match not only UID but machine type,
architecture and OS. Don't assume that the files will be identical
between, say, 32-bit Windows and 64-bit Linux or even the same OS
installed on different CPU families.

Without more info it's hard to tell but it's possible that replication
or other solutions may better address your end goal.

Cheers,
Steve



pgsql-admin by date:

Previous
From: Rama Krishnan
Date:
Subject: Re: Default UID for postgres user in linux
Next
From: "Bui, Michelle P"
Date:
Subject: shared_preload_libraries = $libdir/plugins/plugin_debugger.dll causes server not started