Spotfire® Server and Environment - Installation and Administration

Example script: PostgreSQL database on Google Cloud using create-db command

The following example shows planning for and creating a Spotfire database schema for a PostgreSQL database on Google Cloud.

Use the following code template to plan and create a database schema with the command create-db. See Creating a Spotfire database using the command create-db for instructions.

PostgreSQL database on Google Cloud:
config create-db 
--driver-class="org.postgresql.Driver" 
--database-url="jdbc:postgresql://{{database-host}}:{{database-port}}/{{database-name}}" 
--admin-username="{{admin-user}}" 
--admin-password="{{admin-password}}" 
--spotfiredb-dbname="{{spotfire-database}}" 
--do-not-create-user

For each option shown in the above example, replace the placeholder variable with your own value. The following example shows example values to pass to the command create-db.

Option Example value
--driver-class "org.postgresql.Driver"
--database-url "jdbc:postgresql://myservername:5432/postgres"
--admin-username "postgres"
--admin-password "postgres"
--spotfiredb-dbname "myspotfiredb"
--do-not-create-user --do-not-create-user
Note: Spotfire databases for PostgreSQL created on the cloud do not take a database user name or password, which is why we use the option --do-not-create-user.
In the following code, we have replaced the template variables with the example values. The command is ready to run to create the database schema. Your values will differ.
Note: This example has line breaks to make it easier to read the assigned values. To use this example, you must copy it to a text editor, provide your own values, and remove the line breaks first.
config create-db 
--driver-class="org.postgresql.Driver" 
--database-url="jdbc:postgresql://myservername:5432/postgres"
--admin-username="postgres" 
--admin-password="postgres" 
--spotfiredb-dbname="myspotfiredb" 
--do-not-create-user
Note: For a PostgreSQL database for AWS or Google Cloud providers:
  • If you set the value of admin-username to something other than the default postgres, then you must set a value for the existing PostgreSQL database variable database-name (which is passed as part of the option --database-url).
  • You must provide a value for the option spotfiredb-dbname, which is the name of the Spotfire database that you are creating. (This name is different from the existing PostgreSQL database-name.)

This process ensures that PostgreSQL can connect to the default PostgreSQL database and create the Spotfire database schema.