dbTalk Databases Forums  

[BUGS] minor: ~ not resolved in psql

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] minor: ~ not resolved in psql in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bas Scheffers
 
Posts: n/a

Default [BUGS] minor: ~ not resolved in psql - 10-27-2003 , 10:33 AM






================================================== ==========================
POSTGRESQL BUG REPORT TEMPLATE
================================================== ==========================


Your name : Bas Scheffers
Your email address : bas (AT) scheffers (DOT) 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:
---------------------------------------------------------------------




---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Rod Taylor
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-27-2003 , 11:02 AM






--=-IHXRIwiKglKK/sL7HfoZ
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Quote:
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.

--=-IHXRIwiKglKK/sL7HfoZ
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQA/nU6P6DETLow6vwwRArt7AJ9b56NHPhxpkd9vLyXd9oB1UZrX2g CeJiGo
gfE/Uva9fniZVlkhCiduyvw=
=24Vh
-----END PGP SIGNATURE-----

--=-IHXRIwiKglKK/sL7HfoZ--



Reply With Quote
  #3  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-30-2003 , 12:16 PM



Bas Scheffers writes:

Quote:
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 (AT) gmx (DOT) net


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-30-2003 , 12:27 PM



Peter Eisentraut wrote:
Quote:
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 (AT) candle (DOT) 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #5  
Old   
Rod Taylor
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-30-2003 , 12:32 PM



--=-PJaoI2h5ib54kHalTBcy
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Thu, 2003-10-30 at 13:13, Peter Eisentraut wrote:
Quote:
Bas Scheffers writes:
=20
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.
=20
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.

--=-PJaoI2h5ib54kHalTBcy
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQA/oVgU6DETLow6vwwRAq9zAJ4oxL1d3OhzqPnQOlcbEZvtxHAfhw CdHTue
4z/T8aKP6XRTx9i9chUsfBc=
=qx1+
-----END PGP SIGNATURE-----

--=-PJaoI2h5ib54kHalTBcy--



Reply With Quote
  #6  
Old   
Bas Scheffers
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-30-2003 , 02:31 PM



Peter Eisentraut said:
Quote:
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.



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #7  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-30-2003 , 04:20 PM



Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #8  
Old   
Francisco Olarte Sanz
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 10-31-2003 , 03:48 AM



On Thursday 30 October 2003 19:18, Bas Scheffers wrote:

Quote:
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.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #9  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] minor: ~ not resolved in psql - 11-08-2003 , 10:25 PM



Tom Lane wrote:
Quote:
Bruce Momjian <pgman (AT) candle (DOT) 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 (AT) candle (DOT) 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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.