[PROPOSAL] Make PSQLVAR on \getenv opitional

Поиск
Список
Период
Сортировка
От Matheus Alcantara
Тема [PROPOSAL] Make PSQLVAR on \getenv opitional
Дата
Msg-id wCAsy4b4K4idUpTrjH78m1vjcsfCN3i0ah2NWkw3v44EWL0rk7fgy0KED1n2G6doRAg5hI0-Mv-pgjId394Si3pFxwG6HJBcOsNqoFAMaTc=@pm.me
обсуждение исходный текст
Ответы Re: [PROPOSAL] Make PSQLVAR on \getenv opitional  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hi pgsql hackers, I was testing the new psql command \getenv introduced on commit 33d3eeadb2 and from a user perspective, I think that would be nice if the PSQLVAR parameter were optional, therefore when it is only necessary to view the value of the environment variable, the user just run \getenv, for example:

\getenv PATH
/usr/local/sbin:/usr/local/bin:/usr/bin

And when it is necessary to assign the environment variable in a variable, the user could execute like this:

\getenv PATH myvar
\echo :myvar
/usr/local/sbin:/usr/local/bin:/usr/bin

For this flexibility the order of parameters would need to be reversed, instead of \getenv PSQLVAR ENVVAR would be \getenv ENVVAR PSQLVAR.

What do you guys think? I'm not a C expert but if this proposal is interesting I can write a patch.

This is my first time sending an email here, so let me know if I doing something wrong.



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

Предыдущее
От: tushar
Дата:
Сообщение: Re: refactoring basebackup.c
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: [PROPOSAL] Make PSQLVAR on \getenv opitional