How to Substitute Variables in PostgreSQL The given Oracle query inserts data into table by substituting variables. How I achieve the same in PostgreSQL?

INSERT INTO control_threshold (
    threshold_id, group_name, description, sql, low_value, high_value)
VALUES(
    threshold_seq.nextval, '&amp;2', '&amp;1',  TRIM('&amp;5' || '&amp;6' || '&amp;7' || '&amp;8' || '&amp;9'),
    trim('&amp;3'), trim('&amp;4'));
These variables are a feature of SQL*Plus.

psql, the equivalent program in the PostgreSQL world, also has variables.

Use

\set variable 'value'


and

insert into mytable(mycolumn)
values (:variable);