From the course: PostgreSQL: Client Applications

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Solution: Export a data table

Solution: Export a data table - PostgreSQL Tutorial

From the course: PostgreSQL: Client Applications

Solution: Export a data table

(upbeat music) - [Instructor] I hope you are able to export your data table as an HTML formatted document according to my specifications. Let's go ahead and walk through the solution. I'm going to start up a brand new PowerShell window which places me at my system's Command Prompt. The first thing I need to do is create a connection to the Postgres database. So, psql -h localhost. Connect to the two_trees database and -U to establish the Postgres user as the user that we're going to use. Okay, so that sets up the initial connection. Now I can start passing in some additional parameters or do some additional options. I need to export a file, so I'll set up the output file with -o and I'll specify the file path that I want it to go to. And I'll just place this on my desktop. Now, what are we going to call this? The query that I gave you said that we're going to select everything from inventory.products where the category ID is equal to three. So, I'm going to call this…

Contents