Skip to main content

PostgreSQL - Execute Query

Overview​

Execute any SQL query against a PostgreSQL database, without returning any of the resulting data. This Blueprint should primarily be used for queries that perform functionality other than SELECT, like multi-step SQL jobs, or DML statements.

Variables​

NameReferenceTypeRequiredDefaultOptionsDescription
HostPOSTGRES_HOSTAlphanumericβœ…--The domain or the IP address of the database you want to connect to.
PortPOSTGRES_PORTIntegerβœ…"5432"-Number for the database port to connect to. Defaults to 5432.
UsernamePOSTGRES_USERNAMEAlphanumericβœ…--Name of the user to connect to the database with.
PasswordPOSTGRES_PASSWORDPasswordβž–--Password associated to the provided username.
DatabasePOSTGRES_DATABASEAlphanumericβœ…--Name of the database in the PostgreSQL to connect to.
Extra URL ParametersPOSTGRES_URL_PARAMETERSAlphanumericβž–--Extra parameters that will be placed at the end of the connection string, after the "?". Must be separated by "&".
QueryPOSTGRES_QUERYAlphanumericβœ…--Any SQL query that runs a job against the database (CREATE, DROP, INSERT, etc.). Formatting is ignored.

YAML​

Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.

source:
blueprint: PostgreSQL - Execute Query
inputs:
POSTGRES_HOST: null ## REQUIRED
POSTGRES_PORT: '5432' ## REQUIRED
POSTGRES_USERNAME: null ## REQUIRED
POSTGRES_PASSWORD: null
POSTGRES_DATABASE: null ## REQUIRED
POSTGRES_URL_PARAMETERS: null
POSTGRES_QUERY: null ## REQUIRED
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '200'
- '221'
- '249'