[PATCH] More docs on what to do and not do in extension code - Mailing list pgsql-hackers

From Craig Ringer
Subject [PATCH] More docs on what to do and not do in extension code
Date
Msg-id CAGRY4nxanz6MQrOv_babTjg02VwcXkq+eBsQhqdFX6-PgTapDQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] More docs on what to do and not do in extension code  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Re: [PATCH] More docs on what to do and not do in extension code  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
Hi folks

The attached patch expands the xfunc docs and bgworker docs a little, providing a starting point for developers to learn how to do some common tasks the Postgres Way.

It mentions in brief these topics:

* longjmp() based exception handling with elog(ERROR), PG_CATCH() and PG_RE_THROW() etc
* Latches, spinlocks, LWLocks, heavyweight locks, condition variables
* shm, DSM, DSA, shm_mq
* syscache, relcache, relation_open(), invalidations
* deferred signal handling, CHECK_FOR_INTERRUPTS()
* Resource cleanup hooks and callbacks like on_exit, before_shmem_exit, the resowner callbacks, etc
* signal handling in bgworkers

All very superficial, but all things I really wish I'd known a little about, or even that I needed to learn about, when I started working on postgres.

I'm not sure it's in quite the right place. I wonder if there should be a separate part of xfunc.sgml that covers the slightly more advanced bits of postgres backend and function coding like this, lists relevant README files in the source tree, etc.

I avoided going into details like how resource owners work. I don't want the docs to have to cover all that in detail; what I hope to do is start providing people with clear references to the right place in the code, READMEs, etc to look when they need to understand specific topics.


Attachment

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: [PATCH] Cross-reference comments on signal handling logic
Next
From: Luc Vlaming
Date:
Subject: Re: New Table Access Methods for Multi and Single Inserts