pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Wong <mark@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: doc examples for pghandler
Date: Fri, 12 Jun 2020 15:35:25 -0700
Message-ID: <20200612223525.GB3327@2ndQuadrant.com> (raw)
In-Reply-To: <776992.1591989020@sss.pgh.pa.us>
References: <20200612172648.GA3327@2ndQuadrant.com>
	<776992.1591989020@sss.pgh.pa.us>

On Fri, Jun 12, 2020 at 03:10:20PM -0400, Tom Lane wrote:
> Mark Wong <mark@2ndquadrant.com> writes:
> > Would some additional procedure language handler code examples in the
> > documentation be good to add?  I've put some together in the attached
> > patch, and can log it to a future commitfest if people think it would
> > be a good addition.
> 
> Hmm.  The existing doc examples are really pretty laughable, because
> there's such a large gap between the offered skeleton and a workable
> handler.  So I agree it'd be nice to do better, but I'm suspicious of
> having large chunks of sample code in the docs --- that's a maintenance
> problem, if only because we likely won't notice when we break it.
> Also, if somebody is hoping to copy-and-paste such code, it isn't
> that nice to work from if it's embedded in SGML.
> 
> I wonder if it'd be possible to adapt what you have here into some
> tiny contrib module that doesn't do very much useful, but can at
> least be tested to see that it compiles; moreover it could be
> copied verbatim to serve as a starting point for a new PL.

I do have the code examples in a repo. [1]  The 0.4 directory consists
of everything the examples show.  

It would be easy enough to adapt that for contrib, and move some of the
content from the doc patch into that.  Then touch up the handler chapter
to reference the contrib module.

Does that sound more useful?

[1] https://gitlab.com/markwkm/yappl

-- 
Mark Wong
2ndQuadrant - PostgreSQL Solutions for the Enterprise
https://www.2ndQuadrant.com/





view thread (11+ messages)  latest in thread

Message-ID: <20200612223525.GB3327@2ndQuadrant.com>
Permalink:  ../20200612223525.GB3327@2ndQuadrant.com/
Also on:    postgresql.org/message-id/20200612223525.GB3327@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, tgl@sss.pgh.pa.us
  Subject: Re: doc examples for pghandler
  In-Reply-To: <20200612223525.GB3327@2ndQuadrant.com>
  References: <20200612172648.GA3327@2ndQuadrant.com> <776992.1591989020@sss.pgh.pa.us> <20200612223525.GB3327@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