Re: psql \i handling ~ in specified file name - Mailing list pgsql-patches

From Tom Lane
Subject Re: psql \i handling ~ in specified file name
Date
Msg-id 20005.1071982556@sss.pgh.pa.us
Whole thread Raw
In response to psql \i handling ~ in specified file name  (Zach Irmen <zirmen@shaw.ca>)
List pgsql-patches
Zach Irmen <zirmen@shaw.ca> writes:
> A reviewable patch that could handle tilde expansion for
> psql \i ~/filename

Needs a bit of work.  What happens if getenv("HOME") returns NULL?
You also need to think about Windows (dunno if the whole thing is
even meaningful there, but if it is then you need to allow for
backslash path separators).  Finally, couldn't we reduce the number
of times strings are strdup'd only to be freed again?  I don't think
doing it this way makes the code simpler --- it took me a fair while
to convince myself there was no memory leak.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Temporary tables and miscellaneous schemas
Next
From: Claudio Natoli
Date:
Subject: fork/exec patch: pgstat + BootstrapMain