Re: psql \i handling ~ in specified file name

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zach Irmen <zirmen(at)shaw(dot)ca>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql \i handling ~ in specified file name
Date: 2003-12-21 04:55:56
Message-ID: 20005.1071982556@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Zach Irmen <zirmen(at)shaw(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Claudio Natoli 2003-12-21 04:59:11 fork/exec patch: pgstat + BootstrapMain
Previous Message Bruce Momjian 2003-12-21 04:51:24 Re: [GENERAL] Temporary tables and miscellaneous schemas