Skip to content

[FORMATTING] missing a space before the : at the start of a parameter #917

@affert

Description

@affert

I'm using postgresql in a program that uses ':' to denote parameters to replace. IE if I have a parameter called 'parameter_id', in the query I would put :parameter_id which would be replaced by the value.

The formatter is removing the space before the ':'

Input data

Which SQL and options did you provide as input?

select id, name from employee where name = 'Sam' and :parameter_id = id

Expected Output

select
  id,
  name
from
  employee
where
  name = 'Sam'
  and :parameter_id = id

Actual Output

select
  id,
  name
from
  employee
where
  name = 'Sam'
  and:parameter_id = id

Usage
I'm calling via the 'Official VSCode Extension of SQL Formatter library' ext in Visual Studio Code.
Identifier
renesaarsoo.sql-formatter-vsc
Version
4.2.5

from changelog:
[4.2.5] - 2025-10-02
Upgraded sql-formatter to v15.6.10

I have it configured to use the postgresql dialect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions