Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread David Fetter
On Wed, Mar 09, 2011 at 10:57:53PM -0500, Robert Haas wrote: > On Wed, Mar 9, 2011 at 7:32 PM, David Fetter 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

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Robert Haas
On Wed, Mar 9, 2011 at 7:32 PM, David Fetter 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 comm

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
On Wed, Mar 9, 2011 at 10:07 PM, Andrew Dunstan wrote: > > 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 incl

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Andrew Dunstan
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? Give

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
On Wed, Mar 9, 2011 at 7:32 PM, David Fetter 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

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread David Fetter
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

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread Gurjeet Singh
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 in any of those files should look for

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-09 Thread David Fetter
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 0

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-08 Thread Gurjeet Singh
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 wrote: > Gurjeet! > > What about tab completion, like in \i command? > > On Fri, Feb 25, 2011 at 5:07 AM, Robert Haas > wrote: >

Re: [HACKERS] Fwd: psql include file using relative path

2011-03-08 Thread Ibrar Ahmed
Gurjeet! What about tab completion, like in \i command? On Fri, Feb 25, 2011 at 5:07 AM, Robert Haas wrote: > On Thu, Feb 24, 2011 at 6:21 PM, Gurjeet Singh > wrote: >>     psql has the ability to execute commands from a file, but if one wishes >> to develop and provide a modularized set of sq

Re: [HACKERS] Fwd: psql include file using relative path

2011-02-24 Thread Robert Haas
On Thu, Feb 24, 2011 at 6:21 PM, Gurjeet Singh 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 path