Re: Fwd: psql include file using relative path

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: 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 00:05:19
Message-ID: AANLkTinPtWZ4MBttz0AV6bkgUi14nSDj9qFvzDYTNBP7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards,

On Wed, Mar 9, 2011 at 4:41 PM, David Fetter <david(at)fetter(dot)org> wrote:

> Being able to include relative paths is a really great feature, but
> should it have a UI (well, API) distinct from fixed-path includes? My
> first instinct is that it shouldn't, but I haven't really thought it
> through thoroughly.
>
> Cheers,
> David (the tough coughs as he ploughs the dough)
> On Tue, Mar 08, 2011 at 03:19:40PM -0500, Gurjeet Singh wrote:
> > Attached patch implements tab completion. It also introduces the
> long-form
> > alternative \include_relative for \ir
> >
> > Regards,
> >
> > On Tue, Mar 8, 2011 at 2:18 PM, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
> wrote:
> >
> > > Gurjeet!
> > >
> > > What about tab completion, like in \i command?
> > >
> > > On Fri, Feb 25, 2011 at 5:07 AM, Robert Haas <robertmhaas(at)gmail(dot)com>
> > > wrote:
> > > > On Thu, Feb 24, 2011 at 6:21 PM, Gurjeet Singh <
> singh(dot)gurjeet(at)gmail(dot)com>
> > > wrote:
> > > >> psql has the ability to execute commands from a file, but if one
> > > wishes
> > > >> to develop and provide a modularized set of sql files, then psql is
> not
> > > very
> > > >> helpful because the \i command can open file paths either if they
> are
> > > >> absolute paths or if they are palced correctly relative to psql's
> > > current
> > > >> working directory.
> > > >>
> > > >> Attached patch adds a new meta-command to psql, '\ir' that allows
> the
> > > user
> > > >> to process files relative to currently processing file.
> > > >
> > > > Please add this patch to the currently open CommitFest at:
> > > >
> > > > https://commitfest.postgresql.org/action/commitfest_view/open
> > > >
> > > > --
> > > > Robert Haas
> > > > EnterpriseDB: http://www.enterprisedb.com
> > > > The Enterprise PostgreSQL Company
> > > >
> > > > --
> > > > Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> > > > To make changes to your subscription:
> > > > http://www.postgresql.org/mailpref/pgsql-hackers
> > > >
> > >
> > >
> > >
> > > --
> > > Ibrar Ahmed
> > >
> >
> >
> >
> > --
> > Gurjeet Singh
> > EnterpriseDB <http://www.enterprisedb.com/> Corporation
> > The Enterprise PostgreSQL <http://www.postgresql.org/> Company
>
>
> >
> > --
> > Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-hackers
>
>
> --
> 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
>

--
Gurjeet Singh
EnterpriseDB <http://www.enterprisedb.com/> Corporation
The Enterprise PostgreSQL <http://www.postgresql.org/> Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-03-10 00:14:40 Re: Fwd: index corruption in PG 8.3.13
Previous Message Josh Berkus 2011-03-10 00:03:04 Re: Native XML