Hey, it's Mo back again, and I'm here to quickly explain how to set up your environment on Windows
to allow for quick and easy access to the actual command on Windows, because in our initial set videos,
we were referencing these bin files directly.
Now, if we were to say want to use command line as our main source of interacting with PostgreSQL,
we don't really want to do that.
Right.
So this video is here to show you quickly and easily how to set up Posterous in such a way that you
can use the Piscatella command and all of these commands easily from your command prompt, no muss,
no fuss.
So if you go down here to start and you look for environment variables, you can see that we'll have
this little option here, edit the system, environment variables.
And if we open that up here at the bottom, what you'll find is we'll have a environment variables button
when we click that what we'll see is that you have user variables in this case for education, which
is my user, and you'll have system variables.
Now we want to zoom in on the system variables, and we specifically want to zoom in on the path variable,
because what the path variable is, is it is the variable that is going to be loaded by command line
and subsequently power shell and any other command prompt that you may install or want to use.
But the path variable is basically a variable that in essence will point to all the binaries, all the
executables, the software basically that allows you to run certain commands.
And so if we open up the path variable, what we can see is that you have multiple different options
in here.
We have a system 32, which is pointing to all of the regular commands that we can run in Windows and
all of these other ones.
But we want to zoom in on.
And the most important one is that to the path variable, we add the PostgreSQL bin folder and the Postgres
bin folder bin stands for Binary in.
It adds all of these commands that we can KPG dump, rewind, rewire, all of these different commands
are going to be able to be used.
And one of the most important ones that we want to use is this one.
Now, when we install software, basically what we're doing is we're installing what quote unquote binaries.
And these binaries are would allow us to run certain things.
And in this case, this binary cable is the main command that we use to connect to the postgresql world
from the command prompt.
And when we add the Benfold or the entirety of the bin folder to our path, what we're seeing is, hey,
command prompt, go and actually use this folder and load in all of these binaries for me so that I
can run these commands inside of the system so that I don't have to reference them directly from where
they're at.
You're going to know about them forever.
And by adding this and pressing, OK.
What we can now do and if you already had power, our command line open, what you're going to want
to do is you're going to want to restart it.
Power Shell is by far the best tool that you can use.
I would steer away from command and command lines.
Great for basic usage, but power Shell just has more features and is better overall.
So if we open Power Shell, what we can see is that if we run the actual command now.
It's going to try to log into my default user, but that's not what I want to do.
I want to do well minus you and I want to log into the Posterous user.
And now it's going to ask me for my password, which during set up, we set the posterous.
If I do come info, what I'll see is that I'm connected to the Postgres database.
Now let's go ahead and verify that we can run some of the commands.
So let's create a table.
Let's do create a table.
And let's say it's a test table.
And let's quickly run that what we can see that we've created the table, so if we run D.T., where
we can see is that we have a test table.
So we have the ability now to run all of the commands and log in to PostgreSQL.
Now, I would recommend using Power Shell, because it's a more fully fledged command line, is easier
to use.
The old command line is kind of limited and a bit different.
But yeah, with all of this, we've set up our environments in Windows to be able to access command
line effectively.