Thread

  1. minor: ~ not resolved in psql

    Bas Scheffers <bas@scheffers.net> — 2003-10-27T09:02:48Z

    ============================================================================
                            POSTGRESQL BUG REPORT TEMPLATE
    ============================================================================
    
    
    Your name               : Bas Scheffers
    Your email address      : bas@scheffers.net
    
    
    System Configuration
    ---------------------
      Architecture (example: Intel Pentium)         : Athlon
    
      Operating System (example: Linux 2.0.26 ELF)  : Linux 2.4.22
    
      PostgreSQL version (example: PostgreSQL-7.3.4):   PostgreSQL-7.3.4
    
      Compiler used (example:  gcc 2.95.2)          : RPM (Red Hat "Severn")
    
    
    Please enter a FULL description of your problem:
    ------------------------------------------------
    When opening a file in psql, ~ (the user's home dir) is resolved when
    using tab completion to find the file, but when you hit enter and psql
    actualy tries to open it, you get a file not found error.
    
    
    Please describe a way to repeat the problem.   Please try to provide a
    concise reproducible example, if at all possible:
    ----------------------------------------------------------------------
    N/A
    
    
    If you know how this problem might be fixed, list the solution below:
    ---------------------------------------------------------------------
    
    
    
    
    
  2. Re: minor: ~ not resolved in psql

    Rod Taylor <rbt@rbt.ca> — 2003-10-27T16:57:53Z

    > Please enter a FULL description of your problem:
    > ------------------------------------------------
    > When opening a file in psql, ~ (the user's home dir) is resolved when
    > using tab completion to find the file, but when you hit enter and psql
    > actualy tries to open it, you get a file not found error.
    
    This is an issue in 7.4 as well.
    
  3. Re: minor: ~ not resolved in psql

    Peter Eisentraut <peter_e@gmx.net> — 2003-10-30T18:13:20Z

    Bas Scheffers writes:
    
    > When opening a file in psql, ~ (the user's home dir) is resolved when
    > using tab completion to find the file, but when you hit enter and psql
    > actualy tries to open it, you get a file not found error.
    
    This is not a bug.  If there is not file named ~ then it can't be opened.
    
    -- 
    Peter Eisentraut   peter_e@gmx.net
    
    
    
  4. Re: minor: ~ not resolved in psql

    Bas Scheffers <bas@scheffers.net> — 2003-10-30T18:18:05Z

    Peter Eisentraut said:
    > This is not a bug.  If there is not file named ~ then it can't be
    > opened.
    I am not trying to open a file named ~, I am using it as part of a file
    name, ie: ~/ewap/sql/ewap.sql. (where ~=/home/bas) This is perfectly valid
    on any unix system and especialy since tab completion of \i supports it,
    so should the function that does the actual opening of the file, I would
    think...
    
    Bas.
    
    
    
    
  5. Re: minor: ~ not resolved in psql

    Bruce Momjian <pgman@candle.pha.pa.us> — 2003-10-30T18:24:50Z

    Peter Eisentraut wrote:
    > Bas Scheffers writes:
    > 
    > > When opening a file in psql, ~ (the user's home dir) is resolved when
    > > using tab completion to find the file, but when you hit enter and psql
    > > actualy tries to open it, you get a file not found error.
    > 
    > This is not a bug.  If there is not file named ~ then it can't be opened.
    
    If I am in psql and do:
    
    	\i ~/<tab>
    
    I see all the files in home directory.  If I then type in a file name:
    
    	test=> \i ~/server.log
    	~/server.log: No such file or directory
    
    I get file not found.  Sure looks like a bug to me.
    
    -- 
      Bruce Momjian                        |  http://candle.pha.pa.us
      pgman@candle.pha.pa.us               |  (610) 359-1001
      +  If your life is a hard drive,     |  13 Roberts Road
      +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
    
    
  6. Re: minor: ~ not resolved in psql

    Rod Taylor <rbt@rbt.ca> — 2003-10-30T18:27:33Z

    On Thu, 2003-10-30 at 13:13, Peter Eisentraut wrote:
    > Bas Scheffers writes:
    > 
    > > When opening a file in psql, ~ (the user's home dir) is resolved when
    > > using tab completion to find the file, but when you hit enter and psql
    > > actualy tries to open it, you get a file not found error.
    > 
    > This is not a bug.  If there is not file named ~ then it can't be opened.
    
    If the file doesn't exist, then surely tab completion shouldn't pick it
    up either.
    
    \i ~/.b<tab><tab>  <- picks up files
    
    After finishing a name, hit enter -- the file could not be found.
    
  7. Re: minor: ~ not resolved in psql

    Tom Lane <tgl@sss.pgh.pa.us> — 2003-10-30T22:16:14Z

    Bruce Momjian <pgman@candle.pha.pa.us> writes:
    > Peter Eisentraut wrote:
    >> Bas Scheffers writes:
    >>> When opening a file in psql, ~ (the user's home dir) is resolved when
    >>> using tab completion to find the file, but when you hit enter and psql
    >>> actualy tries to open it, you get a file not found error.
    >> 
    >> This is not a bug.  If there is not file named ~ then it can't be opened.
    
    > Sure looks like a bug to me.
    
    I think so too.  If tab completion can find the file then we ought to be
    willing to open it.  Changing tab completion to not find the file would
    be okay too, or at least consistent.  It's the inconsistency that leads
    me to call it a bug.
    
    			regards, tom lane
    
    
  8. Re: minor: ~ not resolved in psql

    Francisco Olarte <folarte@peoplecall.com> — 2003-10-31T09:46:32Z

    On Thursday 30 October 2003 19:18, Bas Scheffers wrote:
    
    > > This is not a bug.  If there is not file named ~ then it can't be
    > > opened.
    > I am not trying to open a file named ~, I am using it as part of a file
    > name, ie: ~/ewap/sql/ewap.sql. (where ~=/home/bas) This is perfectly valid
    > on any unix system and especialy since tab completion of \i supports it,
    > so should the function that does the actual opening of the file, I would
    > think...
    
    	It's not valid in a unix system. It's an expansion performed by most shells. 
    In my system (Linux, bash2):
    
    [patxifijo:~] ls ~/2do.txt
    /home/folarte/2do.txt
    [patxifijo:~] ls '~/2do.txt'
    ls: ~/2do.txt: No such file or directory
    
    In fact it works with all programs:
    
    [patxifijo:~] echo ~/2do.txt
    /home/folarte/2do.txt
    [patxifijo:~] echo '~/2do.txt'
    ~/2do.txt
    
    F.O.S.
    
    
    
  9. Re: minor: ~ not resolved in psql

    Bruce Momjian <pgman@candle.pha.pa.us> — 2003-11-09T04:23:44Z

    Tom Lane wrote:
    > Bruce Momjian <pgman@candle.pha.pa.us> writes:
    > > Peter Eisentraut wrote:
    > >> Bas Scheffers writes:
    > >>> When opening a file in psql, ~ (the user's home dir) is resolved when
    > >>> using tab completion to find the file, but when you hit enter and psql
    > >>> actualy tries to open it, you get a file not found error.
    > >> 
    > >> This is not a bug.  If there is not file named ~ then it can't be opened.
    > 
    > > Sure looks like a bug to me.
    > 
    > I think so too.  If tab completion can find the file then we ought to be
    > willing to open it.  Changing tab completion to not find the file would
    > be okay too, or at least consistent.  It's the inconsistency that leads
    > me to call it a bug.
    
    Added to TODO:
    
    	* Have psql '\i ~/<tab><tab>' actually load files it displays
    	  from home dir
    
    -- 
      Bruce Momjian                        |  http://candle.pha.pa.us
      pgman@candle.pha.pa.us               |  (610) 359-1001
      +  If your life is a hard drive,     |  13 Roberts Road
      +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073