![]() SELECT is a SQL command that returns information, and we're using a built-in function called version to pull out the server version and installation platform information. We can do that by running SELECT, version, and then an open and close parentheses. One thing that we can do is get details about the installation. Now we can start sending commands to the server. If everything was filled in correctly, you should be connected to the Postgres server and the command prompt will change. When you type, it's not going to appear on the screen, so just type it out and press Enter when you're done. So I hope that you remember what you filled in during that step. Again, we gave the Postgres user account a password during setup. If you've been assigned your own personal user account for your server, you would supply that username here instead. Again, during the installation, we created a superuser account named Postgres. Then we need to provide the user account credentials. This was set up during the installation step, but is typically left at the default of 5432. Next, we need the communication port that the server is listening on. Again, you can press Enter to accept the default value of Postgres. Our server is brand new and there's just one database called Postgres, so I'll log into that one. Each Postgres server can hold many different databases. ![]() Next, it asks you which database you want to connect to. I'll just leave this blank and press Enter to enter in localhost. You can either type that in or simply press Enter and localhost, the default as indicated by the text in square brackets, will be used instead. So we can use the word localhost instead. In our case, we're running the server and client on the same physical machine. If you're in a typical office environment where the Postgres server is running on a centralized computer, then you'll need the IP address of that machine. In order to log into a Postgres server, you need to know some connection details. When you first run the tool, it opens up a command-line window and starts the login process. So let's go ahead and click on it to start it up. And PSQL is a very important tool in the world of Postgres development. However, I do think that it's important to see briefly in order to help reinforce the idea that the client application is completely separate from the database server. ![]() It provides a quick way for administrators to log into the server and run commands, but it's not the most user-friendly environment for new users since it requires that you know what commands you want to run and how to type them out. The PSequel shell that we installed in the last movie is a command-line interface for working with Postgres database servers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |