Re: Fwd: psql include file using relative path

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Robert Haas <robertmhaas(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 03:07:15
Message-ID: 4D784063.8040306@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/09/2011 09:36 PM, Gurjeet Singh wrote:
> If we folded \ir into \i then what would you want `\i 1.sql` to do?
> Read 1.sql from $HOME or the one that is main.sql's sibling.
>
>
> Should stuff break when it has a legitimately accessible path in it
> just because that path is relative?
>
>
> Given the above test case, I think it'd be best if we introduced a new
> command for this feature.
>
>

I agree there's a good case for the new feature. I think someone
mentioned tab completion upthread, and that doesn't make so much sense
to me. This only makes sense nested in a script - in fact if it's not
called from inside an included script (via -f or \i) it should possibly
error out (if it already does this I apologise - I haven't looked at the
patch).

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2011-03-10 03:17:15 Re: Fwd: psql include file using relative path
Previous Message Fujii Masao 2011-03-10 02:58:14 Re: How should the waiting backends behave in sync rep?