Guides
Visit our websiteDeveloper Docs
  • Getting Started with Databrain
    • What is Databrain?
  • ❄️Onboarding & Configuration
    • 📝Sign-Up
    • ✍️Sign-In
    • ✏️Google Sign In Setup for Self-hosted app
    • 🤔Forgot password? Recover your Databrain Account
    • 🌟Onboarding
    • 💾Add a Data Source
    • 🧑Configure Tenants
    • 🆕Create a Workspace
    • 🔓Create a Private Workspace
    • 🆕Create a Dashboard
    • 💠Create a Metric
      • Create Custom Columns
      • Create a Metric using Chat Mode
      • Create a Metric using Custom SQL
    • Workspace Settings
      • General Settings
      • Access Control Settings
      • Cache Settings
      • Download Settings
    • 🗄️Explore Data
  • 🛢️Datasources
    • Connecting Data Sources to Databrain
      • Amazon Redshift
      • Snowflake
      • BigQuery
      • MySQL
      • Postgres
      • MongoDB
      • ElasticSearch
      • DataBricks
      • ClickHouse
      • MSSQL
      • Amazon S3
      • CSV
      • Firebolt
      • SingleStore
      • Athena
    • Allow Access to our IP
    • Add a Data Source
    • Configure Tenants
    • How to Sync a Data Source
    • Edit Tenancy
    • Create a Datamart
    • Semantic Layer
    • Create a Data App
    • Creating a Custom Dataset/View in a Multi-Datasource Environment
  • Workspace
    • Multi Datasource Workspace
  • 🔍DASHBOARDS
    • Edit a Dashboard
    • Share Dashboard
    • Dashboard Settings
    • Create/Modify Dashboard Filter
      • Dashboard Filter - Variable Apply On
      • Add LHS and RHS custom sql support for dashboard filter
    • Customize Layout
    • Adding Elements to Dashboard
    • Import/Export Dashboard
    • Report Scheduler
  • 📉METRIC
    • Edit a Metric
    • Joins , Filter, Sort, Group By
    • Complex Filter
    • Apply Metric Filter
      • Metric Filter - Variable
      • Metric Filter - Custom
    • Switch X axis and Switch Y axis
    • Group By
    • Footnote and Long Description
    • Dynamic Property
    • Archive/Unarchive Metric Card
    • Download Metric Card
    • Download Underlying Data
    • Metric Summary
    • Metric Expression for Single Value Card
    • AI Summary
    • Merge Metrics
    • Section Filters
    • View Unpublished Metrics
  • 📊VISUALIZATIONS - ACTIONS & APPEARANCE
    • Chart Actions
      • Chart Click Action
      • Chart Click Action with Metric
      • Card Click Action
      • Drill Down
      • Cross Dashboard Drill Down
    • Chart Appearance
      • Chart-Specific Appearance Options
  • 🛢️PREVIEW OF DASHBOARDS
    • Email Settings for Scheduled Reports
    • Scheduled Reports for End User
  • 🔍FILTERS
    • Dashboard Filter
    • Metric Filter
    • App filter
  • 💡Features
    • Python Editor Console
    • Custom SQL Console
    • Custom SQL Query Guidelines
  • 🏢Integrating Plugin
    • ✳️Get an auth token
    • 🙏Get a guest token
  • 🛃THEMEING & CUSTOMIZATION
    • 🎨Creating a theme
    • 🖼️View the theme in action
    • ⚙️Reset a saved theme
  • 📊Metric Component (upto version v0.11.15)
    • ✨Quick start
  • 🕸️Web Components
    • ✨Quick start
    • ⚛️Framework Specific Guide
  • 🚀Product Changelog
  • 🤳Self Hosted Changelog
Powered by GitBook
On this page
  1. Datasources
  2. Connecting Data Sources to Databrain

Postgres

PreviousMySQLNextMongoDB

Last updated 19 hours ago

Getting Started with Postgres Source Configuration

Requirements:

  • Active Postgres database instance.

  • Allow connections from Databrain to your Postgres database.

    • For details on setting up IP whitelisting and ensuring secure connectivity, refer to our guide on

  • Choose the Databrain Workspace to which you wish to connect the data.

Setup Guide:

  1. Ensure Database Accessibility:

    • Ensure your Postgres database is active and accessible from the machine running Databrain.

    • Accessibility is dependent on your Postgres user privileges and network settings. The easiest way to verify if Databrain can connect to your Postgres database is via the check connection tool in the UI. For detailed setup and permissions, refer to the Postgres documentation.

  2. Grant Necessary Permissions:

    • Read Access on Tables and information_schema: Grant read access permissions to the tables within Postgres as well as the information_schema schema. This allows Databrain to retrieve necessary information and replicate data accurately. You can assign appropriate permissions to the user or role accessing Postgres to enable reading from tables and accessing metadata stored in the information_schema. -- Grant SELECT permission on all tables in the specified schema GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO <username>

  3. Fill Up Connection Info:

    • Provide the necessary information to connect to your Postgres database:

      • Integration Name: [Pick a name to help you identify this source in Databrain]

      • Host: [Hostname of the database]

      • Port: 5432 (This is the default port for Postgres databases)

      • Database Name: [Name of the database]

      • Username: [Username to access the database]

      • Password: [Password associated with the username]

      • Schemas: Defaults to "public". [Provide a list of schemas (case sensitive) to sync from, if different from the default]

Encryption:

  • SSL Mode: [Specify if the "require_secure_transport" parameter is turned on then enable or disable based on it]

  • To securely connect to your Postgres instance, you might need to provide SSH details:

    • SSH Host: [SSH host endpoint of the SSH instance. Ensure the Databrain IP is whitelisted.]

    • SSH Port: 22

    • Username: [Username to connect to SSH host]

    • Private Key: [Private key to authenticate with the SSH host]

  • Ensure you have SSL/TLS set up for your Postgres database if you require encrypted connections from Databrain for enhanced security.

Permissions:

  • Permission to read information_schema.

  • Whitelist the IP address.

  • Grant read access to the schema (usage) and tables, noting that access to only tables may not suffice in certain databases.

Replace the placeholders inside the square brackets with the actual values when filling in the details.

Locating the Configuration Details in PostgreSQL

  1. Host:

    • For remote PostgreSQL servers, it would be the IP address or domain name of the machine where PostgreSQL is running. You can also check the PostgreSQL configuration file (usually named postgresql.conf) for the listen_addresses setting to confirm.

  2. Port:

    • The default port for PostgreSQL is 5432. However, this can be customized. Confirm the specific port your PostgreSQL instance is using by checking the postgresql.conf file for the port setting.

  3. Database Name:

    • Connect to your PostgreSQL instance and use the command \\l in the psql interface to list all databases.

  4. Username:

    • The credentials you use to access your PostgreSQL database. If you're unsure, consult with the person who set up the PostgreSQL database or your database administrator. Usernames can also be listed by connecting to your database and running the command \\du in the psql interface.

  5. Password:

    • The password associated with the username. This would typically be known by you or set up during the PostgreSQL installation or user creation. PostgreSQL doesn't display passwords for security reasons, so ensure you have it stored securely or reset it if needed.

  6. Schemas:

    • By default, PostgreSQL uses the "public" schema. If you have other schemas in use, connect to your database and run the command \\dn in the psql interface to list them.

  7. SSL mode:

    • PostgreSQL supports various SSL modes. To check the mode in use, refer to the postgresql.conf file for the sslmode setting or consult with your database administrator.

🛢️
Allow Access to our IP