How to set up temporary path for starting up psql in any folder?

Started by Shaozhong SHIover 4 years ago4 messagesgeneral
Jump to latest
#1Shaozhong SHI
shishaozhong@gmail.com

How to set up temporary path for starting up psql in any folder?

I do not want to disrupt existing settings of paths.

Regards,

David

#2Shaozhong SHI
shishaozhong@gmail.com
In reply to: Shaozhong SHI (#1)

How to set up temporary path for starting up psql in any folder?

I do not want to disrupt existing settings of paths.

Regards,

David

#3Francisco Olarte
folarte@peoplecall.com
In reply to: Shaozhong SHI (#1)
Re: How to set up temporary path for starting up psql in any folder?

On Mon, 4 Oct 2021 at 12:40, Shaozhong SHI <shishaozhong@gmail.com> wrote:

How to set up temporary path for starting up psql in any folder?
I do not want to disrupt existing settings of paths.

You will need to provide a lot more details ( like your OS, and wheter
you just want to open the "psql" binary or modify the paths for other
things ).

In simple OSs like mine, plain Debian Linux, you can start psql in the
folder $FOLDER by just doing "$FOLDER/psql". To launch it using
temporary override of PATH you will need to do "PATH=$FOLDER:$PATH
psql".

But anyway, this is a shell-101 question, not much to do with
postgres, you'll have to ask someone who knows your
os/shell/whatever.

Francisco Olarte.

#4Steve Midgley
science@misuse.org
In reply to: Shaozhong SHI (#2)
Re: How to set up temporary path for starting up psql in any folder?

On Mon, Oct 4, 2021 at 4:29 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:

How to set up temporary path for starting up psql in any folder?

I do not want to disrupt existing settings of paths.

This isn't really a Pg SQL question so I think you're posting to the wrong
group. Doing what you want depends on the OS but it's pretty easy to append
to a path without overwriting the user account-defined paths on the current
console. Or you can create some kind of system batch file that you can use
to load Pg which will add the paths you want and then load psql and then
unset the paths afterwards.. You might try superuser for help on setting
paths and creating batch files along these lines?

Steve