From: Tom Lane <tgl@sss.pgh.pa.us>
To: paul.deaudney@safetyculture.com, Paul De Audney <paul.deaudney@safetyculture.io>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Query returns error "there is no parameter $1" but server logs that there are two parameters supplied
Date: Mon, 17 Jul 2023 09:45:26 -0400
Message-ID: <4011573.1689601526@sss.pgh.pa.us> (raw)
In-Reply-To: <CACKYwcL_dBUemZ4ksa608cGo4+yf6ca6t3pF1YyFN36+VpqD4w@mail.gmail.com>
References: <CACKYwcL_dBUemZ4ksa608cGo4+yf6ca6t3pF1YyFN36+VpqD4w@mail.gmail.com>
Paul De Audney <paul.deaudney@safetyculture.io> writes:
> 2023-07-17 01:39:20.265 UTC [1857486] user@db_name ERROR: there is no
> parameter $1 at character 24
> 2023-07-17 01:39:20.265 UTC [1857486] user@db_name CONTEXT: unnamed portal
> with parameters: $1 = 'template_31f98dcda25c482eb0b086a0081d28a8', $2 =
> 'template_31F98DCDA25C482EB0B086A0081D28A8'
> 2023-07-17 01:39:20.265 UTC [1857486] user@db_name STATEMENT:
> SELECT templates.id, templates.rev, templates.json,
> meta.template_data as meta_template_data, meta.date_draft_modified,
> meta.draft_author_name
> FROM templates
> LEFT JOIN templates_meta as meta
> ON templates.id = meta.id
> WHERE (templates.id = $1 OR templates.id = $2)
"character 24" is not anywhere near where the $1 symbol is in that
query string, so I'm betting that this error does not refer to the
outer client-submitted query but to some plpgsql or sql function that
is getting invoked along the way. Since you've provided exactly no
context for this log snippet, it's hard to speculate further than
that.
(And yeah, if that is how such a problem gets logged then I agree
we could stand to work on providing better error context. But again,
without a reproducible test case it's hard to make any progress.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, paul.deaudney@safetyculture.io, pgsql-bugs@lists.postgresql.org
Subject: Re: Query returns error "there is no parameter $1" but server logs that there are two parameters supplied
In-Reply-To: <4011573.1689601526@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox