Query Postgres

White Label Data can query Postgres data warehouses and connect the results to a visualization. First, you must Create a Postgres Connection. To add a query to a visualization, you create a <query> section in a Layer file and write your SQL query. Then, you add a step to the pipeline corresponding to that query. A Postgres query configuration looks as follows:


<query name="myquery">


    "steps" : [
            "action" : "postgres_query",
            "query_name": "myquery"



Option Value(s) Description
action postgres_query Specifies that it is a Postgres query.
query_name A string The name of the query specified in a <query> tag within the combined Layer.
output_dataframe A string The name to use when creating a new DataFrame. This allows you to have multiple DataFrames in the pipeline context and to map columns from multiple queries to a single visualization. If no name is specified, the DataFrame will be named after the query name.
connection A string Optional. The name of the connection specified in appconfig.json. This is only needed if there are two connections of the same type. For example, if you have two Postgres connections, you need to specify which one to use for this Postgres query pipeline step.
shared true or false Indicates whether the query is shared and available to multiple visualizations. See Shared Queries.