Re: Fwd: psql include file using relative path

From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: psql include file using relative path
Date: 2011-03-10 05:56:49
Message-ID: 20110310055649.GA9994@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 09, 2011 at 10:57:53PM -0500, Robert Haas wrote:
> On Wed, Mar 9, 2011 at 7:32 PM, David Fetter <david(at)fetter(dot)org> wrote:
> > On Wed, Mar 09, 2011 at 07:05:19PM -0500, Gurjeet Singh wrote:
> >> Good question, I hadn't thought of that either, and thinking
> >> about it a bit I think we'd want to keep the current behaviour of
> >> \i and provide new behaviour using a new command.
> >>
> >> Say when we are processing a pretty nested file after multiple
> >> \ir commands, a \i <relative path file> in any of those files
> >> should look for that file in psql's CWD/PWD. That is what the
> >> user expects from \i command currently and I don't think it'd be
> >> desirable to break that assumption.
> >
> > I'm not sure I understand.  Stuff that worked before would still
> > work.
> >
> > Should stuff break when it has a legitimately accessible path in
> > it just because that path is relative?
>
> You're confused. The point is whether the path is relative to PWD
> or to the directory in which the currently executing script is
> located. If you want to allow people to get either interpretation,
> you need two commands.
>
> In interactive use, I believe there's no difference between the two.

Thanks for clearing that up :)

OK, nothing to see here. Move along ;)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-10 07:07:33 Re: src/test/isolation/specscanner.l is a few bricks shy of a load
Previous Message Tom Lane 2011-03-10 04:54:55 src/test/isolation/specscanner.l is a few bricks shy of a load