Skip to content

"INTERVAL $1" is not parameterized  #1593

@haoliangyu

Description

@haoliangyu

I have a query like this

UPDATE
  my_table
SET
  expire_after = now() + INTERVAL $1
RETURNING *

and try to parameterize the query with

pg.query(my_query, ['30 seconds'])

It doesn't work and throws an error :-(

ERROR:  syntax error at or near "$1" at character xxx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions