![]() The fastest method for getting PostgreSQL setup on MacOS is to use the Postgres.app. There is a plethora of ways to install PostgreSQL on MacOS, many of which include the full server and associated tools. Again, depending on the distribution you’re using for the WSL host, the package commands may be slightly different. On Windows 10 or greater, it’s possible to install the tools in a Windows Subsystem for Linux 2 (WSL2) environment and use the normal Linux package management to install the components as shown above. Through the installation process, you can decide which parts of the server and tools to install. If you want to use psql through a Windows command prompt, then you need install PostgreSQL and all tools using the Windows installation package found on. Once completed, verify installation by checking for the psql version as shown previously. $ > sudo apt - get install postgresql - client From a terminal or Windows command prompt, type the following: Check For psqlīecause psql comes bundled with the PostgreSQL server, there’s a possibility you already have it available on your computer if you’ve ever installed PostgreSQL. There is a lot of effort taken to keep psql backwards compatible within the supported PostgreSQL versions, so a newer version of psql should work with at least the last five major releases. It comes pre-bundled with the PostgreSQL server installation package or it can be installed independently as a stand-alone CLI application.Īlso, psql is versioned alongside PostgreSQL because the queries that it runs when you use meta-commands need to work with newer catalog schemas. ![]() The psql command line tool (CLI) is available on Linux, MacOS, and Windows. In total, I think learning some of the basics is worth the time of investment. Knowing how to connect to a database and run basic commands will quickly pay dividends in your PostgreSQL work. TL DR – psql is a powerful tool to have in your PostgreSQL toolbelt. Knowing how to connect with the tool and run basic meta-commands will quickly help you follow along. This can be a gateway into learning many of the underlying catalog tables in PostgreSQL that control every aspect of how the database is used.Īnd last, but certainly not least, is that many (many!) articles, tutorials, books, and videos that show you how to use PostgreSQL features will often demonstrate concepts using psql. It’s like having a tool with hundreds of efficient shortcuts to quickly work with the database.Įven more powerful is that you can configure psql to return the SQL that it runs for each command along with the results. Using the meta-commands becomes second nature for getting details about database objects. As a former, long-time SQL Server developer I know the lack of a consistent, standardized GUI tool felt really frustrating at times.Īfter a while, however, I realized that it is often much easier to jump into a database with psql when I just need to connect, look at schemas, and run simple queries. If you’re new to the PostgreSQL space, using a command line utility to connect to and query the database might feel outdated. With every release of PostgreSQL, additional features and improvements are made to the psql utility to provide more power to end users. PostgreSQL 6.0 was released under the guidance of the new PostgreSQL Global Development Group and amazing work hasn’t stopped since. Postgres95 is released with a very liberal PostgreSQL License, based on POSTGRES source code, but QUEL is replaced with SQL! The monitor terminal application will no longer work, and psql was provided as the new terminal tool for interacting with Postgres95 ![]() It maintained the QUEL query language now called POSTQUEL, and so the monitorapplication could continue to be used with POSTGRES POSTGRES (after INGRES) was started and developed. One of the terminal programs that was used to interact with INGRESS was called monitor ![]() INGRES, the grandfather of PostgreSQL, developed and used a proprietary query language called QUEL. To understand why PostgreSQL has its own command line utility and why it is so integrated into how developers work with PostgreSQL, we need to take a quick step into the time-travel machine and remind ourselves how PostgreSQL became PostgreSQL. Knowing how to install and use basic psql commands is an essential skill to have for anyone that will connect to PostgreSQL. Many long-term PostgreSQL users, developers, and administrators rely on psql to help them quickly connect to databases, examine the schema, and execute SQL queries. PostgreSQL has a separate command-line tool that’s been available for decades and is included with any installation of PostgreSQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |