pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Wong <mark@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: doc examples for pghandler
Date: Mon, 17 Aug 2020 16:30:07 -0700
Message-ID: <20200817233007.GA20236@2ndQuadrant.com> (raw)
In-Reply-To: <20200814052552.GE2057@paquier.xyz>
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>

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/

Attachments:

plsample-readme.diff (text/plain, 473B) download 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.

view thread (11+ messages)  latest in thread

Message-ID: <20200817233007.GA20236@2ndQuadrant.com>
Permalink:  ../20200817233007.GA20236@2ndQuadrant.com/
Also on:    postgresql.org/message-id/20200817233007.GA20236@2ndQuadrant.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: mark@2ndquadrant.com, michael@paquier.xyz, tgl@sss.pgh.pa.us
  Subject: Re: doc examples for pghandler
  In-Reply-To: <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> <20200817233007.GA20236@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox