Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLJ7P-002ndK-4w for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Jul 2023 07:58:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qLJ7N-006XAX-Md for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Jul 2023 07:58:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLJ7N-006X7I-EE for pgsql-bugs@lists.postgresql.org; Mon, 17 Jul 2023 07:58:05 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLJ7K-000rjJ-S0 for pgsql-bugs@lists.postgresql.org; Mon, 17 Jul 2023 07:58:04 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51bece5d935so6018977a12.1 for ; Mon, 17 Jul 2023 00:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1689580681; x=1692172681; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=mHfsvBSxysRi7gDRqGM13HAtQKHEyaA4rVxS+cmAdeM=; b=cO6lDE/yRun5Q2OuYfHIwL9TySClPFxS8QsvkQUMys0YtvRINdgXfwxfeW1fRBBNJn uUX63x1w/RHtzPup44GyGxmOwbrmXYuD+4ALIxegqp+LnrEsoZD29Fn0vb9e3bIqCNPq WQ4woA5RENqZ8W9pyjft8AMRyC+gklCW2abuop2Xic2zxP0lGT2/qWcGWuzXD325jCr+ ApP5Fl1MvBeBiSxhM0sq/WcipEhxJ9HBry5BBE3d5WI6PmowfTS8BRy+ftrOczeN0JuJ irJoqlsemT1yHiEZWe3mKYK1cbm0htbjSWzytB0J9iHb3aiKAdrxp8nm2vW+ZniCcI1q yHNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689580681; x=1692172681; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mHfsvBSxysRi7gDRqGM13HAtQKHEyaA4rVxS+cmAdeM=; b=DUpyICQfVogrdUMaBNg2I24ye0gjV6gyjx8vYsHnR7KxeI0YuHhh1POTcNcEelhutu bxeBQQtYzpK8DNUdj2ZPiYeK5LOvYIT6EJUEOwblRK3OyBetQOC0gBb5O582G8YxPTzL UJ86Khir/P9oo/7WOppuseH+kbFKIh7ddkZrY01WqScrcMdl487jbBY2ujbB2mfGI1HC 0ylzD7e+GuyrMFGnmbcrICyVoH2WN0ViVyyRYLhzFi/5qpbNoyuD5IYsSuofv4LgIQVf t6PFGHdzkgDtCX54tz3Nw15Ie+raFlpUa660Y7/5fQreNzizRGjk7cz/Hw/yRda1vpW1 wKGA== X-Gm-Message-State: ABy/qLaTs46Atnise3gJH5JST3eq9rInUWA+EXSGkEA+Wbbj7O0urpH5 3cv0IkLpIjpOmY+cytqbX+YtndHmqIpIP8WDXkM= X-Google-Smtp-Source: APBJJlELjPmoncF0A48kwDT3um/DD7BTdm30D4E2fo8a2VEUY9IlLNsrpcYGUrFdrsI3Swd07u84NA== X-Received: by 2002:aa7:d895:0:b0:51f:f079:8761 with SMTP id u21-20020aa7d895000000b0051ff0798761mr10353119edq.15.1689580681433; Mon, 17 Jul 2023 00:58:01 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:4fc2:f2f6:7179:233d:e889]) by smtp.gmail.com with ESMTPSA id d10-20020a056402078a00b0051bfc7763c2sm9510860edy.25.2023.07.17.00.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 00:58:01 -0700 (PDT) Message-ID: <96b08d4083eb2a5fd39f7b71d34f963aefcabf3c.camel@cybertec.at> Subject: Re: Query returns error "there is no parameter $1" but server logs that there are two parameters supplied From: Laurenz Albe To: paul.deaudney@safetyculture.com, pgsql-bugs@lists.postgresql.org Date: Mon, 17 Jul 2023 09:58:00 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-07-17 at 12:25 +1000, Paul De Audney wrote: > We have other queries logging the same error on a different database on t= he same server infrastructure using golang based connection pools/drivers (= jackc/pgx). >=20 > 2023-07-17 01:39:20.265 UTC [1857486] user@db_name ERROR: =C2=A0there is = no parameter $1 at character 24 > 2023-07-17 01:39:20.265 UTC [1857486] user@db_name CONTEXT: =C2=A0unnamed= portal with parameters: $1 =3D 'template_31f98dcda25c482eb0b086a0081d28a8'= , $2 =3D 'template_31F98DCDA25C482EB0B086A0081D28A8' > 2023-07-17 01:39:20.265 UTC [1857486] user@db_name STATEMENT: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT templates.id, tem= plates.rev, templates.json, meta.template_data as meta_template_data, meta.= date_draft_modified, meta.draft_author_name > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FROM templates > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0LEFT JOIN templates_meta as meta > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ON templates.id =3D meta.id > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WHERE (templates.id =3D = $1 OR templates.id =3D $2) >=20 > This query does work when re-run exactly as shown there. To determine if that is a bug in PostgreSQL or the PostgreSQL driver, pleas= e reproduce the problem on a test system with "log_min_duration_statement =3D 0" and sh= ow all relevant parts of the log file. Yours, Laurenz Albe