Re: splitting *_desc routines - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: splitting *_desc routines
Date
Msg-id 20121123215219.GB4558@alvh.no-ip.org
Whole thread Raw
In response to Re: splitting *_desc routines  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: splitting *_desc routines  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: splitting *_desc routines  (Simon Riggs <simon@2ndQuadrant.com>)
Re: splitting *_desc routines  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Robert Haas escribió:
> On Thu, Oct 25, 2012 at 4:25 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> > I'd put these in a separate directory to avoid annoyance. Transam is
> > already too large.
>
> +1.  A further advantage of that is that it means that that everything
> in that new directory will be intended to end up as
> all-separately-compilable, which should make it easier to remember
> what the rules are, and easier to design an automated framework that
> continuously verifies that it still works that way.

So incorporating these ideas, the layout now looks like this:

./commands/seq_desc.c
./commands/dbase_desc.c
./commands/tablespace_desc.c
./catalog/storage_desc.c
./utils/cache/relmap_desc.c
./access/rmgrdesc/mxact_desc.c
./access/rmgrdesc/spgdesc.c
./access/rmgrdesc/xact_desc.c
./access/rmgrdesc/heapdesc.c
./access/rmgrdesc/tupdesc.c
./access/rmgrdesc/xlog_desc.c
./access/rmgrdesc/gistdesc.c
./access/rmgrdesc/clog_desc.c
./access/rmgrdesc/hashdesc.c
./access/rmgrdesc/gindesc.c
./access/rmgrdesc/nbtdesc.c
./storage/ipc/standby_desc.c

There are two files that are two subdirs down from the backend
directory:

./storage/ipc/standby_desc.c
./utils/cache/relmap_desc.c

We could keep them in there, or we could alternatively create more
"rmgrdesc" subdirs for them, so

./storage/rmgrdesc/standby_desc.c
./utils/rmgrdesc/relmap_desc.c

This approach appears more future-proof if we ever want to create desc
routines in other subdirs in storage/ and utils/, though it's a bit
annoying to have subdirs that will only hold a single file each (and a
very tiny file to boot).

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: autovacuum truncate exclusive lock round two
Next
From: Alvaro Herrera
Date:
Subject: Re: splitting *_desc routines