Skip to content

[BUG]: live.query silently binds positional params in textual order #1055

Closed

Description

@nightridefm

https://github.com/electric-sql/pglite/blob/main/packages/pglite/src/utils.ts#L53-L56

formatQuery emits %NL instead of %N$L
%NL is 'pad with whitespace to width=N'
NOT 'use argument at position N'

SELECT format('%2L %1L',  'first', 'second');  -- 'first' 'second' (sequential, incorrect)
SELECT format('%2$L %1$L','first', 'second');  -- 'second' 'first' (positional, correct)
SELECT format('%1L %1L',  'only');             -- ERROR: too few arguments for format()
SELECT format('%1$L %1$L','only');             -- 'only' 'only'
SELECT format('%20L %1L',  'first', 'second'); --              'first' 'second' (13 leading whitespace)

Activity

  1. added
    bug
    on Jul 17, 2026
  2. added a commit that references this issue on Aug 12, 2026
    354f4ae
  3. added a commit that references this issue on Aug 18, 2026
  4. added a commit that references this issue on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions