Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrcuH-0000Yv-PC for pgsql-general@arkaria.postgresql.org; Fri, 11 Jun 2021 08:52:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrcuG-0000rr-OB for pgsql-general@arkaria.postgresql.org; Fri, 11 Jun 2021 08:52:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrcuG-0000qf-DD for pgsql-general@lists.postgresql.org; Fri, 11 Jun 2021 08:52:48 +0000 Received: from mail1.dalibo.net ([212.83.143.11] helo=mail.dalibo.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrcuB-0007qq-O2 for pgsql-general@lists.postgresql.org; Fri, 11 Jun 2021 08:52:47 +0000 Received: from firost (larco.ioguix.net [78.202.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id 07F6820300; Fri, 11 Jun 2021 10:52:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1623401561; bh=HNj783FG7zEuL7noeJYNyWbqAqrzeQ/85J51V2xeEeM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HhUjLmvoD/fFS5GgjP/++H+jC78y6N+Xw0R8PN/tLjUZzPJ48eQir9MSKNcP0wJAA iItT/YSsdVjeqLWadsIs46v9Pm0P1ojCbbCG68aujfkWMBjIBIEzRAeP8C7q0n3GrI sJy4OC6C2Kdc8MbaknyGaKyvjSBZ7uDJrbItLStM= Date: Fri, 11 Jun 2021 10:52:40 +0200 From: Jehan-Guillaume de Rorthais To: Hassan Camacho Cadre Cc: pgsql-general@lists.postgresql.org Subject: Re: How to pass a parameter in a query to postgreSQL 12 Message-ID: <20210611105240.58659fd3@firost> In-Reply-To: References: Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 9 Jun 2021 14:51:46 -0500 Hassan Camacho Cadre wrote: > Hello > > > I recently installed a postgreSQL v12, in previous version 8.3 in all my > queries I pass parameters using the character : > > SELECT > > public.tabla.id > > FROM > > public.tabla > > WHERE > > public.tabla.id = :a > > In the new version when I try to make this query it sends me an error > > ERROR syntax error at or near ":" > [...] > I am executing this query on the query editor of pgadmin 4 The :varname syntaxe is only understood by psql, which parse it and replace it with the value BEFORE sending the query to postgres. pgAdmin doesn't know this syntaxe. If you need to parameterize a query in pure SQL, use PREPARE/EXECUTE. Regards,