Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC4BJ-0006LI-Au for pgsql-general@arkaria.postgresql.org; Fri, 27 Apr 2018 14:17:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fC4BI-0001sn-97 for pgsql-general@arkaria.postgresql.org; Fri, 27 Apr 2018 14:17:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC4BG-0001sa-Gg for pgsql-general@lists.postgresql.org; Fri, 27 Apr 2018 14:17:00 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC4BA-0006Dn-KS for pgsql-general@postgresql.org; Fri, 27 Apr 2018 14:16:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 85A1421660; Fri, 27 Apr 2018 10:16:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 27 Apr 2018 10:16:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=3giytC3jsmE4h/NnXcH4aMuoGm1xc wG8nx6VAyWISro=; b=gYlgR7klaGUT1BG/gJUURdoy1/anHRQjorjhiCO3lBPsT vZwkh1HUvSGFi4jSqVVKHZqsUO/tYWcDNq+zuhQh6+r0tiCO00+3XDh1pxNYDZ/L fPy8zqJMmgNMf5yGKYy7SUiJnYkXru9dCPWvcDK4aV+8rgKfC0v7/+hY26Mq22Dt AgxkafwhVzgjm6foK4xPZQ/t4t4sG5YGpYh7aIUi+N6DS65QzEcoKNeMhsk/kexp 9KDy27pyXvpBXKb3WVa3VKO44rtWCQLxRi7EhS7PWvKTyz3lKpE0vVSdPB420WKo Gpn+M7yti/DxYWR27fGNHdwvdfZAz7TIwNG6meBfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3giytC 3jsmE4h/NnXcH4aMuoGm1xcwG8nx6VAyWISro=; b=iYh0s3Il07L5tC+ZFWPzQz LpDsArof6TNEZBHhXrDdJqyMd3/iEHNo75qlu1gjT90vik/J/PScEYpMOhqcVcU0 a0YHa7BnLhHUNs33BaPmRv8cUY98lBEttvs5bIM/IAxVN3BssPhPZwX27UKA1IMJ Vm9lJZ4IUdOSfxN4eIpXjyypk0prqa9W1F0ha4QXn5fxa568AiW7f15GYP99x9z0 0HkSreEtcX7dTjTR9i36E9zgvS1+6JZIStSnYEHOh5PjWLonTAAKLvbcAZ7Uxt+v eM3O3segWFDu3L6ch98hBoQfHwjdvznFcS6hfoaUTMWPvrTt9YaAvKQX4pGZVU4g == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id E860510261; Fri, 27 Apr 2018 10:16:48 -0400 (EDT) Subject: Re: Parameter passing in trigger function write in C To: a <372660931@qq.com>, pgsql-general References: <2b430e72-4278-3ab5-76c3-90a33c091764@aklaver.com> From: Adrian Klaver Message-ID: <33ab2922-ab4e-8680-c949-82a230b885e7@aklaver.com> Date: Fri, 27 Apr 2018 07:16:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; 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 04/26/2018 06:48 PM, a wrote: > hey thanks mate, I have red that. But the actual data retirement seems > to be combination of that and the SPI_get* functions. I'm still testing > on it. By the way, if I can pass parameters that is out of the scope of > sql statement?? Can you be more specific about what parameters you are looking to pass in? > > > ------------------ Original ------------------ > *From:* "Adrian Klaver"; > *Date:* Friday, Apr 27, 2018 9:36 AM > *To:* "a"<372660931@qq.com>; "pgsql-general"; > *Subject:* Re: Parameter passing in trigger function write in C > > On 04/26/2018 06:13 PM, a wrote: > > Hey everyone: > > > > I was request to write a trigger that perform the following function: > > > > 1, The trigger will be set to exam all statement that will result change > > of datas > > > > 2, The trigger will exam three information other than the data updated > > or inserted: user name, password and reasons of change > > > > 3, It will record down, in some format, the time and content of the > change. > > > > Therefore, I would need some way of passing parameters into the trigger > > function. Can anyone give me some instructions on how to do it or, if it > > is possible?? > > https://www.postgresql.org/docs/10/static/trigger-interface.html > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com -- Adrian Klaver adrian.klaver@aklaver.com