Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZKiYu-0001En-L7 for pgsql-docs@arkaria.postgresql.org; Thu, 30 Jul 2015 07:47:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZKiYu-0001CO-6l for pgsql-docs@arkaria.postgresql.org; Thu, 30 Jul 2015 07:47:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZKiYZ-0000oz-52 for pgsql-docs@postgresql.org; Thu, 30 Jul 2015 07:47:11 +0000 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZKiYW-0000f7-Ca for pgsql-docs@postgresql.org; Thu, 30 Jul 2015 07:47:09 +0000 Received: by wibxm9 with SMTP id xm9so232256753wib.0 for ; Thu, 30 Jul 2015 00:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=h4/jBM66xvBjLooCmmgwmXgSf3L5Mn9TuDXNotx7HwA=; b=s5mGK0HQr58StFgxCO6npC9iUOw9zuZwFdRj6mgGy0MnYuPyESmFlsq2XcTSRnqVvg A8uuO67Eh/C+532rJMef3k0X2AOOeVvYnA3Nw1poBR9j7jC/Ux1GoUAP+3sScfGgXx+u o9i0C7pLF/hv3UqE91PJqDGZSLLRUWQcTKhaBn1fAjG49vs1l+7NZ1Zwkym2VNEJpbNb Z5lnNVSIE+r0OTGu7Q3O7GqKpx0JrFThzevAv+TAYabojwvOQjQnemOLLYW3Vp4sJKTB MVhN/WA35YNH+OFcCp0aovlSpEGnFVkSyZqGkRHC2IZze+h5jvDGjEh8F85TlTgfgKPA yVuw== X-Received: by 10.180.7.129 with SMTP id j1mr3698874wia.39.1438242425513; Thu, 30 Jul 2015 00:47:05 -0700 (PDT) Received: from [192.168.1.105] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by smtp.gmail.com with ESMTPSA id wx9sm393080wjb.6.2015.07.30.00.47.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2015 00:47:05 -0700 (PDT) Message-ID: <55B9D677.8000800@iki.fi> Date: Thu, 30 Jul 2015 10:47:03 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Robert Haas , Craig Ringer CC: pgsql-docs Subject: Re: bgworker / SPI docs patches References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On 07/29/2015 09:42 PM, Robert Haas wrote: > + > + > + Use of this field is deprecated. It should be set to > + NULL then bgw_library_name > + and bgw_function_name should be used instead. > + > > I don't think bgw_main is exactly deprecated. It's fine to use it if > the function is in the core code; it just can't be safely used for > functions in dynamically loaded shared libraries. Maybe that's close > enough to "deprecated" that we should just call it deprecated, but I'm > slightly reluctant to use that word. Hmm. worker_spi module uses bgw_main. Is that bad? Given that work_spi is supposedly an example or template that you copy-paste from when writing your own bgworker, we should make sure it follows the best practice. Also, I note that worker_spi doesn't memset(0) its BackgroundWorker struct, so any uninitialized fields will contain garbage. Including bgw_library_name and bgw_function_name. That seems bad. > I've committed some bits of this that seem useful and controversial > with rather extensive wordsmithing; let me know if it doesn't look > good. I've marked this as committed in the commitfest. If we're waiting for a followup patch for the remaining bits, please change it back to Waiting on Author, or post the followup patch to the next commitfest if it can't be done quickly. - Heikki -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs