Re: Tablespaces in the data directory
От | Magnus Hagander |
---|---|
Тема | Re: Tablespaces in the data directory |
Дата | |
Msg-id | CABUevExkhE+KcQa+fLUeaizP5i5QVCnNjZ2j0ZZQcaMJFheQDw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Tablespaces in the data directory (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: Tablespaces in the data directory
Re: Tablespaces in the data directory |
Список | pgsql-hackers |
<p dir="ltr"><br /> On Dec 3, 2012 2:55 AM, "Andrew Dunstan" <<a href="mailto:andrew@dunslane.net">andrew@dunslane.net</a>>wrote:<br /> ><br /> ><br /> > On 12/02/2012 07:50PM, Magnus Hagander wrote:<br /> >><br /> >> On Sat, Dec 1, 2012 at 6:56 PM, Tom Lane <<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>>wrote:<br /> >>><br /> >>> Magnus Hagander <<ahref="mailto:magnus@hagander.net">magnus@hagander.net</a>> writes:<br /> >>>><br /> >>>>Someone just reported a problem when they had created a new tablespace<br /> >>>> inside theold data directory. I'm sure there can be other issues<br /> >>>> caused by this as well, but this is mainlya confusing scenario for<br /> >>>> people now.<br /> >>>> As there isn't (as far as I knowat least) any actual *point* in<br /> >>>> creating a tablespace inside the main data directory, should we<br/> >>>> perhaps disallow this in CREATE TABLESPACE? Or at least throw a<br /> >>>> WARNING ifone does it?<br /> >>><br /> >>> It could be pretty hard to detect that in general (think symlinks<br/> >>> and such). I guess if we're just trying to print a helpful warning,<br /> >>> we don'thave to worry about extreme corner cases. But what exactly<br /> >>> do you have in mind --- complain aboutany relative path? Complain<br /> >>> about absolute paths that have a prefix matching the DataDir?<br />>><br /> >> Oh, I hadn't thought quite so far as the implementation :) Was looking<br /> >> to see ifthere were going to be some major objections before I even<br /> >> started thinking about that.<br /> >><br/> >> But for the implementation, I'd say any absolute path that have a<br /> >> prefix matching DataDir.Tablespaces cannot be created using relative<br /> >> paths, so we don't have to deal with that.<br /> >><br/> ><br /> > I have been known to symlink a tablespace on a replica back to a directory in the datadir,while on the primary it points elsewhere. What exactly is the problem?<p dir="ltr">That wouldn't be affected by thisthough, since it would only warn at create tablespace. <p dir="ltr">I'd still consider it a bad idea in general to dothat, since you're basically messing with the internal structure of the data directory. Why not just link it to some placeoutside the data directory? <p dir="ltr">One obvious problem with it atm is that pg_basebackup breaks, in that it backsup your data twice, and throws warnings about things that aren't links if you actually out it inside pg_tblspc. <p dir="ltr">/Magnus
В списке pgsql-hackers по дате отправления: