Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 129C192B8EB for ; Thu, 5 Jul 2012 17:10:53 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SmsO4-0002eA-Dq for pgsql-bugs@postgresql.org; Thu, 05 Jul 2012 20:10:52 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q65KAbXm022346; Thu, 5 Jul 2012 16:10:38 -0400 (EDT) From: Tom Lane To: Josh Kupershmidt cc: jgd@well.com, pgsql-bugs@postgresql.org Subject: Re: BUG #6715: 9.2b2 psql \ir does not understand leading ../ In-reply-to: <18464.1341513777@sss.pgh.pa.us> References: <9781.1341384106@sss.pgh.pa.us> <18464.1341513777@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 05 Jul 2012 14:42:57 -0400" Date: Thu, 05 Jul 2012 16:10:37 -0400 Message-ID: <22344.1341519037@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/33 X-Sequence-Number: 33509 I wrote: > On reflection I think that what we need to do is fix it so that it only > strips "../" from the tail string when there is a directory name > available to be stripped from the head string. Otherwise just stop > trimming. Actually, there is a much simpler fix: don't let it strip ".." at all. There is no correctness reason to do that, and as for cosmetics, callers who care can use canonicalize_path() to remove ".." correctly. (AFAICS, all existing callers of join_path_components already do so anyway.) regards, tom lane