Skip to content

Postgres

There is No Magic!

This Syncer uses the highly popular psycopg project under the hood.

This means the syncer should transparently support any pg dialect (eg. Amazon RDS, Amazon Aurora, Google Cloud SQL, CockroachDB in pg mode, etc.)

Parameters

Required parameters are in red and Optional parameters are in blue.


  • host, the IP address or URL of your postgres cluster

  • port, how to write new data into existing tables
    default: 5432

  • database, the database to write new data to
    if tables do not exist in the database.schema location already, we'll auto-create them

  • schema, the schema to write new data to
    default: public
    if tables do not exist in the database.schema location already, we'll auto-create them

  • username, your Snowflake username

  • secret, the secret value to pass to the authentication mechanism
    this will be your password

  • load_strategy, how to write new data into existing tables
    default: APPEND ( allowed: APPEND, TRUNCATE, UPSERT )

Serverless Requirements

If you're running CS Tools    serverless, you'll want to ensure you install these    python requirements.

🧙 Don't know what this means? It's probably safe to ignore it.

How do I use the Syncer in commands?

CS Tools accepts syncer definitions in either declarative or configuration file form.

Find the copy button to the right of the code block.

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "postgres://host=pgdb-internal.company.com&database=thoughtspot&username=tsadmin" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    host = "pgdb-internal.company.com"
    port = 5432
    database = "thoughtspot"
    schema = "cs_tools"
    username = "tsadmin"
    secret = "[redacted]"
    load_strategy = "TRUNCATE"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer postgres://syncer-overwrite.toml --config dogfood