Table of Contents
- Connect Row Zero to PostgreSQL
- Write a query to import data
- Dynamically filter, plot, and pivot Postgres
- Export spreadsheet data to Postgres
Connect Row Zero to PostgreSQL
In Row Zero click on the 'connections' icon in the upper right-hand corner and then click the button to '+ Add connection.'
The connection requires 6 pieces of information defined below.
- Name - This field can be anything that helps identify the data source being connected. (e.g. "Production Data" or "Product Metrics")
- Host - This is the PostgreSQL address that typically takes the form of a string like 'database.mydomain.com'.
- Port - This is always 5432.
- User - This is the username for your PostgreSQL database.
- Password - The password used to log into your PostgreSQL Database.
- Database - The name of the PostgreSQL database being connected to.
Once all the information is entered, hit 'Test connection' to ensure the information is correct. If the test connection icon turns green and says 'Connected', proceed by clicking on '+ Add Source.'
*Note - If your database is behind a VPN or firewall, you'll need to allow the Row Zero IP addresses: 18.217.97.112 and 18.224.119.220.
Write a query to import data
Now that Postgres is connected to a spreadsheet in Row Zero, write a SQL query to pull data into the spreadsheet. First select the 'Schema' from the drop down. Write a query in the query editor. The easiest query to write is the 'select *' statement, which pulls in the entire table. Example:
select * from TABLENAME
Row Zero is equipped to handle large data sets and will easily ingest the entirety of a table. Write more complicated queries to pull in various subsets of data stored in a Postgres Database. All results will be displayed in the connected data table in the spreadsheet.
Dynamically filter, sort, chart, and pivot Postgres
Now that Row Zero is connected to Postgres, you can use Row Zero as a powerful postgres GUI to view, slice, and analyze postgres data. Leverage all the features and functions of spreadsheets to filter, sort, pivot, and chart Postgres data instead of writing complex SQL queries, waiting for run times, or exporting postgres to CSV.
Export to Postgres
Row Zero also makes it easy to export your spreadsheet to Postgres. To export a sheet or range of cells, simply select the cells you'd like to export, right-click, select Export to, and select your Postgres database.
Select your Postgres database, schema, and name your table. Note, tables must start with "rz_". This is to prevent accidently overwriting existing tables in your database.
To export a data table, connected table, or pivot table, simply click the dropdown in the top-left of the table and select Export to. Check out our video tutorial below to see exporting to postgres in action, or view our post for how to use Row Zero to import CSV files to postgres.