> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL Writeback Connector

## Intro

To learn more about PostgreSQL, visit their website at [https://www.postgresql.org/](https://www.postgresql.org/ "https://www.postgresql.org/")

You export data to a PostgreSQL database in the Data Center. This topic discusses the fields and menus that are specific to the PostgreSQL Database Writeback connector user interface. General information for adding DataSets, setting update schedules, and editing DataSet information is discussed in [Adding a DataSet Using a Data Connector](https://domo-support.domo.com/s/article/360042926274?language=en_US "Adding a DataSet Using a Data Connector").

<Note>**Note:** The owner of a writeback dataset must also be an owner or co-owner of the input dataset.</Note>

## Prerequisites

To configure this connector, you will need the following:

* A Domo Client ID and Client Secret. To obtain these credentials, do the following:

  1. Log into your Domo developer account at
     [https://developer.domo.com/login](https://developer.domo.com/login "https://developer.domo.com/login").
  2. Create a new client.
  3. Select the desired data and user application scope.
  4. Click **Create**.

* Your SQL database or schema name.

* The hostname or IP address of your PostgreSQL database server.

* The port number of your PostgreSQL server.

* Your PostgreSQL username and password.

If you don't know any of your SQL credentials, contact your SQL Database Administrator.

You may also paste the text for a PostgreSQL CA certificate (or you may input the URL where the certificate is located), but this is optional.

<Warning>
  **Important**: You will need the following permissions on PostgreSQL:

  * CONNECT
  * SELECT
  * CREATE
  * INSERT
</Warning>

## Configuring the Connection

This section enumerates the options in the **Credentials** and **Details** panes in the PostgreSQL Writeback Connector page. The components of the other panes in this page, **Scheduling** and **Name & Describe Your DataSet**, are universal across most connector types and are discussed in greater length in [Adding a DataSet Using a Data Connector](https://domo-support.domo.com/s/article/360042926274?language=en_US "Adding a DataSet Using a Data Connector").

## Credentials Pane

This pane contains fields for entering credentials to connect to your Domo developer account as well as the table in your PostgreSQL database where you want your data to be copied to. The following table describes what is needed for each field:

<table border="1" cellpadding="1" cellspacing="1" data-aura-rendered-by="33:195;a">
  <thead>
    <tr>
      <th colspan="1" rowspan="1">
        <p>
          <span class="s1"> Field </span>
        </p>
      </th>

      <th colspan="1" rowspan="1">
        <p>
          <span class="s1"> Description </span>
        </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td colspan="1" rowspan="1">
        <p> Domo Client ID </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your Domo client ID. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Domo Client Secret </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your Domo client secret. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Username </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your PostgreSQL username. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Password </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your PostgreSQL password. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Host </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your PostgreSQL database hostname. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Port </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter your PostgreSQL database port number. </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Certificate </p>
      </td>

      <td colspan="1" rowspan="1">
        <p>
          {" "}

          Paste the text for your CA certificate, or enter the URL where your certificate is located. By default no certificate
          is required.{" "}
        </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Certificate Type </p>
      </td>

      <td colspan="1" rowspan="1">
        <p>
          {" "}

          Select a certificate type. This must match what you enter in the <b> Certificate </b> field. If you are not aware
          of a special certificate, select <b> No certificate </b>.{" "}
        </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Database Name </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Enter the name of your PostgreSQL database. </p>
      </td>
    </tr>
  </tbody>
</table>

For more information about obtaining these credentials, see "Prerequisites," above.

Once you have entered valid credentials, you can use the same account any time you go to set up a new Domo-PostgreSQL connection. You can manage connector accounts in the **Accounts** tab in the Data Center. For more information about this tab, see [Managing User Accounts for Connectors](https://domo-support.domo.com/s/article/360042926054?language=en_US "Managing User Accounts for Connectors").

## Details Pane

This pane contains a number of fields for specifying your data and indicating where it's going.

<table border="1" cellpadding="1" cellspacing="1" data-aura-rendered-by="33:195;a">
  <thead>
    <tr>
      <th colspan="1" rowspan="1">
        <p> Menu </p>
      </th>

      <th colspan="1" rowspan="1">
        <p> Description </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td colspan="1" rowspan="1">
        <p> DataSet ID </p>
      </td>

      <td colspan="1" rowspan="1">
        <p>
          {" "}

          Enter the DataSet ID (GUID) for the DataSet you want to copy to PostgreSQL. You can find the ID by opening the
          details view for the DataSet in the Data Center and looking at the portion of the URL following

          <span class="mt-font-courier-new">
            {" "}

            datasources/{" "}
          </span>

          . For example, in the URL

          <span class="mt-font-courier-new">
            <span class="nowiki">
              <a href="https://mycompany.domo.com/datasources/845305d8-da3d-4107-a9d6-13ef3f86d4a4/details/overview" rel="noopener" target="_blank">
                {" "}

                [https://mycompany.domo.com/datasources/845305d8-da3d-4107-a9d6-13ef3f86d4a4/details/overview\{](https://mycompany.domo.com/datasources/845305d8-da3d-4107-a9d6-13ef3f86d4a4/details/overview\{)" "}
              </a>
            </span>
          </span>

          , the DataSet ID is <span class="mt-font-courier-new"> 845305d8-da3d-4107-a9d6-13ef3f86d4a4. </span>
        </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Table Name Source </p>
      </td>

      <td colspan="1" rowspan="1">
        <p> Choose how the SQL table should be named. </p>

        <ul>
          <li>
            <p>
              <b> DataSet ID: </b> The table name will be the number you entered for <b> DataSet ID </b>.{" "}
            </p>
          </li>

          <li>
            <p>
              <b> DataSet Name: </b> The table name will be the same as that of the input DataSet.{" "}
            </p>
          </li>

          <li>
            <p>
              <b> Custom Name: </b> You will give the table a custom name in the <b> Custom Table Name </b> field.{" "}
            </p>
          </li>
        </ul>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Operation Type </p>
      </td>

      <td colspan="1" rowspan="1">
        <div>
          <div> Select an operation type to perform: </div>

          <div>
            <table class="zebra-striped bordered">
              <tbody>
                <tr>
                  <th colspan="1" rowspan="1">
                    {" "}

                    Operation{" "}
                  </th>

                  <th colspan="1" rowspan="1">
                    {" "}

                    Description{" "}
                  </th>
                </tr>

                <tr>
                  <td colspan="1" rowspan="1">
                    {" "}

                    Create New Table{" "}
                  </td>

                  <td colspan="1" rowspan="1">
                    {" "}

                    Creates a new table. (This will create a new table for every execution. The table name will be the name
                    specified above plus a numeric counter).{" "}
                  </td>
                </tr>

                <tr>
                  <td colspan="1" rowspan="1">
                    {" "}

                    Update an Existing Table{" "}
                  </td>

                  <td colspan="1" rowspan="1">
                    {" "}

                    Allows you to update an existing table (if the table name matches the existing one in the MySQL Server;
                    otherwise it will create a new table in the first run).{" "}
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Custom Table Name </p>
      </td>

      <td colspan="1" rowspan="1">
        <p>
          {" "}

          Enter the name for the SQL table in your PostgreSQL database, where you want your DataSet data to be copied.{" "}
        </p>
      </td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1">
        <p> Table Update Method </p>
      </td>

      <td colspan="1" rowspan="1">
        <p>
          {" "}

          When you select the
          <b> Operation Type </b> as
          <b> Update an Existing Table </b>, the

          <b>
            {" "}

            Table Update Method{" "}
          </b>

          field appears. <br /> Select how you want to update the database table:{" "}
        </p>

        <table border="1">
          <tbody>
            <tr>
              <td colspan="1" rowspan="1">
                <b> Field </b>
              </td>

              <td colspan="1" rowspan="1">
                <b> Description </b>
              </td>
            </tr>

            <tr>
              <td colspan="1" rowspan="1">
                {" "}

                Append Data{" "}
              </td>

              <td colspan="1" rowspan="1">
                {" "}

                Appends the fetched data to the existing table.{" "}
              </td>
            </tr>

            <tr>
              <td colspan="1" rowspan="1">
                {" "}

                Overwrite With New Data (Drop and Create Table){" "}
              </td>

              <td colspan="1" rowspan="1">
                {" "}

                Drops the existing table, recreates the table and then writes newly fetched data to the table.{" "}
              </td>
            </tr>

            <tr>
              <td colspan="1" rowspan="1">
                {" "}

                Overwrite With New Data (Truncate Table){" "}
              </td>

              <td colspan="1" rowspan="1">
                {" "}

                Overwrites the existing data with newly fetched data to the existing table by truncating the existing data.{" "}
              </td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

## Other Panes

For information about the remaining sections of the connector interface, including how to configure scheduling, retry, and update options, see [Adding a DataSet Using a Data Connector](https://domo-support.domo.com/s/article/360042926274?language=en_US "Adding a DataSet Using a Data Connector").
