Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Craig Ringer
On Thu., 21 Jun. 2018, 04:30 Tom Lane, wrote: > Ashwin Agrawal writes: > > Okay just bouncing another approach, how about generating UUID for a > > postgres instance during initdb and pg_basebackup ? > > There's no uuid generation code in core postgres, for excellent reasons > (lack of portabili

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Tom Lane
Ashwin Agrawal writes: > Okay just bouncing another approach, how about generating UUID for a > postgres instance during initdb and pg_basebackup ? There's no uuid generation code in core postgres, for excellent reasons (lack of portability and lack of failure modes are the main objections). This

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Ashwin Agrawal
On Wed, Jun 20, 2018 at 10:50 AM Andres Freund wrote: > > > On June 20, 2018 10:31:05 AM PDT, Ashwin Agrawal > wrote: > >On Wed, Jun 20, 2018 at 9:39 AM Bruce Momjian wrote: > > > >> On Fri, May 25, 2018 at 02:17:23PM -0700, Ashwin Agrawal wrote: > >> > > >> > On Fri, May 25, 2018 at 7:33 AM, T

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Andres Freund
On June 20, 2018 10:31:05 AM PDT, Ashwin Agrawal wrote: >On Wed, Jun 20, 2018 at 9:39 AM Bruce Momjian wrote: > >> On Fri, May 25, 2018 at 02:17:23PM -0700, Ashwin Agrawal wrote: >> > >> > On Fri, May 25, 2018 at 7:33 AM, Tom Lane >wrote: >> > >> > Ashwin Agrawal writes: >> > > Propo

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Ashwin Agrawal
On Wed, Jun 20, 2018 at 9:39 AM Bruce Momjian wrote: > On Fri, May 25, 2018 at 02:17:23PM -0700, Ashwin Agrawal wrote: > > > > On Fri, May 25, 2018 at 7:33 AM, Tom Lane wrote: > > > > Ashwin Agrawal writes: > > > Proposing to create directory with timestamp at time of creating > > t

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Andres Freund
Hi, Hi, On 2018-05-26 10:08:57 -0400, Tom Lane wrote: > Not sure about the relative-path idea. Seems like that would create > a huge temptation to put tablespaces inside the data directory, which > would force us to deal with that can of worms. It doesn't seem impossible to normalize the path,

Re: Avoiding Tablespace path collision for primary and standby

2018-06-20 Thread Bruce Momjian
On Fri, May 25, 2018 at 02:17:23PM -0700, Ashwin Agrawal wrote: > > On Fri, May 25, 2018 at 7:33 AM, Tom Lane wrote: > > Ashwin Agrawal writes: > > Proposing to create directory with timestamp at time of creating > tablespace > > and create symbolic link to it instead. > >

Re: Avoiding Tablespace path collision for primary and standby

2018-05-29 Thread Ashwin Agrawal
On Sat, May 26, 2018 at 7:08 AM, Tom Lane wrote: > Thomas Munro writes: > > I also wondered about this when trying to figure out how to write a > > TAP test for recovery testing with tablespaces, for my undo proposal. > > I was starting to wonder about either allowing relative paths or > > suppo

Re: Avoiding Tablespace path collision for primary and standby

2018-05-26 Thread Tom Lane
Thomas Munro writes: > I also wondered about this when trying to figure out how to write a > TAP test for recovery testing with tablespaces, for my undo proposal. > I was starting to wonder about either allowing relative paths or > supporting some kind of variable in the tablespace path that could

Re: Avoiding Tablespace path collision for primary and standby

2018-05-25 Thread Michael Paquier
On Sat, May 26, 2018 at 02:10:52PM +1200, Thomas Munro wrote: > I also wondered about this when trying to figure out how to write a > TAP test for recovery testing with tablespaces, for my undo proposal. > I was starting to wonder about either allowing relative paths or > supporting some kind of va

Re: Avoiding Tablespace path collision for primary and standby

2018-05-25 Thread Thomas Munro
On Sat, May 26, 2018 at 9:17 AM, Ashwin Agrawal wrote: > To generate uniqueness for the path between primary and standby need to use > something which is not represented within database. So will be random to > some degree. Like one can use PORT number of postmaster. As only need to > generate uniq

Re: Avoiding Tablespace path collision for primary and standby

2018-05-25 Thread Ashwin Agrawal
On Fri, May 25, 2018 at 7:33 AM, Tom Lane wrote: > Ashwin Agrawal writes: > > Proposing to create directory with timestamp at time of creating > tablespace > > and create symbolic link to it instead. > > I'm skeptical that this solves your problem. What happens when the CREATE > TABLESPACE comm

Re: Avoiding Tablespace path collision for primary and standby

2018-05-25 Thread Tom Lane
Ashwin Agrawal writes: > Proposing to create directory with timestamp at time of creating tablespace > and create symbolic link to it instead. I'm skeptical that this solves your problem. What happens when the CREATE TABLESPACE command is replicated to the standby with sub-second delay? Clock sk