Re: psql \i handling ~ in specified file name

Поиск
Список
Период
Сортировка
От Zach Irmen
Тема Re: psql \i handling ~ in specified file name
Дата
Msg-id 003301c3d5b0$64cb20a0$0b01010a@ed.shawcable.net
обсуждение исходный текст
Ответ на Re: psql \i handling ~ in specified file name  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: psql \i handling ~ in specified file name  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian wrote:
> Here is a patch that handles "~" in all the file cases.

Beat me to it. :)

I do have a few issues that I was trying to sort out myself regarding this, but I guess now is as good a time as any to
askthem 
here.

First off, there should be a check after the malloc to make sure NULL wasn't returned in the expand_tilde function. I
missedthat 
one.

Secondly, there are a couple of SQL commands (like COPY and LOAD) and psql commands handled outside command.c (like
\copy)which 
also take filenames. I'm guessing that eventually you'll want substitution in those cases as well. So does this mean
thatthe 
expand_tilde function probably should not be in command.c? Placing it in common.c seems the logical place to make it at
least
available to all the psql commands (\copy included).

And finally, I was wondering if arguments with leading pipes (e.g. "|~/file") should  also get substituted.

Zach Irmen


В списке pgsql-patches по дате отправления:

Предыдущее
От: "Korea PostgreSQL Users' Group"
Дата:
Сообщение: Patch of intarray module in v7.4.1
Следующее
От: Claudio Natoli
Дата:
Сообщение: fork/exec patch: CreateProcess calls for Win32