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 1kw8Ay-00029f-BQ for pgsql-general@arkaria.postgresql.org; Sun, 03 Jan 2021 18:32:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kw8Ax-0000ie-AI for pgsql-general@arkaria.postgresql.org; Sun, 03 Jan 2021 18:32:23 +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 1kw8Ax-0000iX-2S for pgsql-general@lists.postgresql.org; Sun, 03 Jan 2021 18:32:23 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kw8Aq-0001Dw-Uy for pgsql-general@lists.postgresql.org; Sun, 03 Jan 2021 18:32:22 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EED5E5C008E; Sun, 3 Jan 2021 13:32:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 03 Jan 2021 13:32:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=p gV8scsyid8oakAQAliNUDSY4cxoVE+L7NAQ7Yh6oIo=; b=ZgucPo7xih4ibQOCN 2cF/BTzlSWO6c1m4J7qi6ISaaxkODJj95MfmUKSwHi12XouuR16j/9IrTRd6k7XQ slhWj0EY0EOIJ71YklxnRZRnzgmM4JPn0pf8+2EW62MwppWO2GQQUNGyzpyw7KdR ZxsNc4DSFXB3gpiTGGYq87EVyahX/umZM1bm7o49yJU0mIqaWqpwNfd5edusROnH ooINRqB+85mStDCcWtYZMz2T0gRQuOKVHf7KxNtU+yDYKRcorQZUs40hZeFnYAMF GzNGYLZhlO+a3IJk5HyaYuY6XeOdZp5TurzdC3KxHLTu0iPql8+khZYcfEuu+wLG qo/xQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=pgV8scsyid8oakAQAliNUDSY4cxoVE+L7NAQ7Yh6o Io=; b=eNosCt5PS/Ry5LtG1PstmgEMQiZKiyEMn0sZl/yQ7pXeY7FtxBIKGM1hD XzYNmpvwrBLBhTbk4jNV+Y/v104NN9wFe0ony+61hLtskkMuAsCy+nZgyGs5qfrg CgGUEf2XfXCY2D88Flm7RsVinqVCiIGGI7Mxy93TmThTHTUPcZnLcUUOHl8BV1hP QZq1y+A/mml8veCgQom3TVXHEvcxT7ChsiABa3rFitQHOr3ajapwTE/KW3z4FYn/ eOv2gVrvSETk2t6gneKmlrWyJhKZCzWOclduLCb2PoXcTZ61b1u9EPg3tEgN3/Lp RzU014XzZmGWHoOFpPk3bCLuQSy8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepveevfeevfeeugeffkeekhfegieeufffgteeujedv gffhueejjefhkeejleegtdegnecukfhppeejhedrudejvddrudegrddujeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (75-172-14-17.tukw.qwest.net [75.172.14.17]) by mail.messagingengine.com (Postfix) with ESMTPA id C100224005E; Sun, 3 Jan 2021 13:32:14 -0500 (EST) Subject: Re: Possible trigger bug? function call argument literalised To: Thiemo Kellner Cc: PostgreSQL General References: <20210103180840.Horde.Fe4qNP3Uviz_9c6aPfxBTS2@webmail.gelassene-pferde.biz> <2692292.1609695452@sss.pgh.pa.us> <20210103184529.Horde.LO8-skyriHu3oMxD4rNG2WV@webmail.gelassene-pferde.biz> <20210103192741.Horde.RQ2ogTUGBJnpkIZYTeDRPO-@webmail.gelassene-pferde.biz> From: Adrian Klaver Message-ID: Date: Sun, 3 Jan 2021 10:32:13 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210103192741.Horde.RQ2ogTUGBJnpkIZYTeDRPO-@webmail.gelassene-pferde.biz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/3/21 10:27 AM, Thiemo Kellner wrote: > > Quoting Adrian Klaver : > >>> Well, I guess, I can put the correct schema at installation, but >>> would have liked to have a more general approach. Furthermore, I >>> think this also implies that installation can only be done by psql. :-s >> >> Why not grab the CURRENT_SCHEMA in the function?: >> >> DECLARE >>     V_COUNT     smallint; >>     C_SCHEMA    varchar := CURRENT_SCHEMA; > > Thank you all for your lightning fast replies. I failed to set it at > install time. \gset cannot be used as bind variables in SQL. So, I try > retaining the restriction to that the function needs to be installed in > the same schema as the triggered table. > Alright you lost me. Can you provide an outline form of what you are trying to accomplish? -- Adrian Klaver adrian.klaver@aklaver.com