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 1k7oa6-0000Pl-Dw for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2020 23:30:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k7oa3-0004nk-VL for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2020 23:30:19 +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 1k7oa3-0004nd-Jx for pgsql-hackers@lists.postgresql.org; Mon, 17 Aug 2020 23:30:19 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k7oa0-0002v1-QZ for pgsql-hackers@lists.postgresql.org; Mon, 17 Aug 2020 23:30:18 +0000 Received: by mail-pj1-x1041.google.com with SMTP id d4so8379290pjx.5 for ; Mon, 17 Aug 2020 16:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gygf95kI7awO+iyoMU3ujm9xxMDH07MXxF3JW7LX96k=; b=P7TcQhY0f48/nDaGyIDqlWs0tmru5ET+wH0hr7e/PgxYhwmfLDglTTS+U4eo82IIF0 4qHXpPumm2ComdQJKeCP42iVQqnE/8+OqI8Pq5G9ZNvJYcqmAdaaJnliAu/vQ0d9Zw5U glF/m0lkpQgRR8d949Kn+9QrtBFckSkK3zWS9VV5FL69nFvtCvI6wbfp8dmxnftm1HFN HPIjMtVo1iAygPDrwMfGvxowGYMis3ARTk3v1AZsDUpOFKMblgKyhtT90MopwXIRSYcN rEGdUMKa/Z3LHWunEOgVhQkXaWPXRzpweNgzSR9eYZzkzTy6DNkW6Jq3VrYxHE+wUzyS 7qug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gygf95kI7awO+iyoMU3ujm9xxMDH07MXxF3JW7LX96k=; b=qIbPOZZG4pXvjaewV5NgvgBKqndg+6owI0tJn1Lwc9xzknZWMN8/7z1nAJqwD7NpJ5 CQQSJN/G95p25WkPHfLy0q12WGu89A62+RZkXH2Wcx4p7TXVd9CFmyHSP5LKTMnyjzc0 I/x2TmcVDUtfiye04rfYx8D7QcJ31ZdL6WJYxcTvr8JkLFHuwo2Do+gFJbfASKaTEqJn YurjV7AhVVKirUh0QOdaxqtp2V5EmB/tM7X07XrE75L0niRllVhJ1CBlO1F+YzE/LvvK v46d8Dqy3dCEDYq3NldO2szWm3ZBrl/h7yXMcrrUkWk9cYcO3mDtce7cBIMPeEm4rFE3 htrQ== X-Gm-Message-State: AOAM530MemRXKlPSpV+mlteNJ9mwcDjBRjCwfTomq7qjxpoXMAQLiObz 2MI5irdNtbAvd6hm/1uJ2YJuh/mCCdxM6g== X-Google-Smtp-Source: ABdhPJyNk/2glbo+2OEqUCnEPnXi71+q7rsgtahMD6+cx+/Hy5Pf596jBDTSAs0YG44xxzGOB/xqTA== X-Received: by 2002:a17:90b:c90:: with SMTP id o16mr13729209pjz.79.1597707014750; Mon, 17 Aug 2020 16:30:14 -0700 (PDT) Received: from 2ndQuadrant.com (c-67-169-212-172.hsd1.or.comcast.net. [67.169.212.172]) by smtp.gmail.com with ESMTPSA id e22sm18261088pgi.62.2020.08.17.16.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 16:30:13 -0700 (PDT) Date: Mon, 17 Aug 2020 16:30:07 -0700 From: Mark Wong To: Michael Paquier Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: doc examples for pghandler Message-ID: <20200817233007.GA20236@2ndQuadrant.com> References: <20200612172648.GA3327@2ndQuadrant.com> <776992.1591989020@sss.pgh.pa.us> <20200612223525.GB3327@2ndQuadrant.com> <796709.1592014421@sss.pgh.pa.us> <20200613041917.GK3362@paquier.xyz> <20200615034517.GA20670@2ndQuadrant.com> <20200615074701.GJ52676@paquier.xyz> <20200811200109.GA26294@2ndQuadrant.com> <20200814052552.GE2057@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <20200814052552.GE2057@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 14, 2020 at 02:25:52PM +0900, Michael Paquier wrote: > On Tue, Aug 11, 2020 at 01:01:10PM -0700, Mark Wong wrote: > > Ah, right. For the moment I've added some empty conditionals for > > trigger and event trigger handling. > > > > I've created a new entry in the commitfest app. [1] I'll keep at it. :) > > Thanks for the patch. I have reviewed and reworked it as the > attached. Some comments below. > > +PGFILEDESC = "PL/Sample - procedural language" > + > +REGRESS = create_pl create_func select_func > + > +EXTENSION = plsample > +EXTVERSION = 0.1 > > This makefile has a couple of mistakes, and can be simplified a lot: > - make check does not work, as you forgot a PGXS part. > - MODULES can just be used as there is only one file (forgot WIN32RES > in OBJS for example) > - DATA does not need the .control file. > > .gitignore was missing. > > We could just use 1.0 instead of 0.1 for the version number. That's > not a big deal one way or another, but 1.0 is more consistent with the > other modules. > > plsample--1.0.sql should complain if attempting to load the file from > psql. Also I have cleaned up the README. > > Not sure that there is a point in having three different files for the > regression tests. create_pl.sql is actually not necessary as you > can do the same with CREATE EXTENSION. > > The header list of plsample.c was inconsistent with the style used > normally in modules, and I have extended a bit the handler function so > as we return a result only if the return type of the procedure is text > for the source text of the function, tweaked the results a bit, etc. > There was a family of small issues, like using ALLOCSET_SMALL_SIZES > for the context creation. We could of course expand the sample > handler more in the future to check for pseudotype results, have a > validator, but that could happen later, if necessary. Thanks for fixing all of that up for me. I did have a couple mental notes for a couple of the last items. :) I've attached a small word diff to suggest a few different words to use in the README, if that sounds better? Regards, Mark -- Mark Wong 2ndQuadrant - PostgreSQL Solutions for the Enterprise https://www.2ndQuadrant.com/ --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="plsample-readme.diff" diff --git a/src/test/modules/plsample/README b/src/test/modules/plsample/README index 7d44d7b3f2..afe3fa6402 100644 --- a/src/test/modules/plsample/README +++ b/src/test/modules/plsample/README @@ -2,5 +2,5 @@ PL/Sample ========= PL/Sample is an example template of procedural-language handler. It is [-kept-]a [-maximum simple, and-]{+simple implementation, yet+} demonstrates some of the things that can be done to build a fully functional procedural-language handler. --ew6BAiZeqk4r7MaW--