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 1m8QqL-0000n8-TZ for pgsql-general@arkaria.postgresql.org; Tue, 27 Jul 2021 17:26:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m8QqK-0003Od-SN for pgsql-general@arkaria.postgresql.org; Tue, 27 Jul 2021 17:26:12 +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 1m8QqK-0003OV-JQ for pgsql-general@lists.postgresql.org; Tue, 27 Jul 2021 17:26:12 +0000 Received: from srv01.teladesign.ie ([2001:41c9:1:41d::10]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8QqH-0005g0-JD for pgsql-general@postgresql.org; Tue, 27 Jul 2021 17:26:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rodonnell.ie; s=exim; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Message-ID; bh=HrA00Ni6O6r5vykRsIV8OrK24pS7oqHX7MS3UV4PmFo=; b=OPn3bp5v/0M9/H+AwX99mzXDuK PHCnd6UDULvFdbH7xmoB2w/abTWeoX6vfXLSNNYsLlgbipY4Bq7YBg0+Z66xMsOc2gJ+wiDo4oj7R fzIeNpoQiktE8UURrc2h1sED4M3O2wSCRfY68wDauEbYLBF7rYK6gM4929sWHjQ1PuAY=; Received: from [93.107.231.214] (helo=[192.168.1.21]) by srv01.teladesign.ie with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m8QqE-0002Cs-FQ; Tue, 27 Jul 2021 18:26:06 +0100 Subject: Re: PHP: query with parameter for SET To: Pavel Stehule Cc: PostgreSQL References: <73cf54bb-7bd8-78f2-7997-c4e7d1ac7b0c@rodonnell.ie> From: Ray O'Donnell Message-ID: <6b74789d-abc6-24e6-ccb7-ef638e6560db@rodonnell.ie> Date: Tue, 27 Jul 2021 18:26:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27/07/2021 18:20, Pavel Stehule wrote: > When you use client side prepared statements, then it can be possible. > But I don't know how it works in PHP. > > Server side prepared statements are not possible in this case. "set" > statement has not execution plan. But you  You can use Adrian's > proposal, and you can prepare the query 'select set_config($1, false)' Thanks Pavel - that makes sense. Ray. -- Raymond O'Donnell // Galway // Ireland ray@rodonnell.ie