postgresql/src/backend/access/rmgrdesc
Tom Lane 2d00190495 Rationalize common/relpath.[hc].
Commit a730183926 created rather a mess by
putting dependencies on backend-only include files into include/common.
We really shouldn't do that.  To clean it up:

* Move TABLESPACE_VERSION_DIRECTORY back to its longtime home in
catalog/catalog.h.  We won't consider this symbol part of the FE/BE API.

* Push enum ForkNumber from relfilenode.h into relpath.h.  We'll consider
relpath.h as the source of truth for fork numbers, since relpath.c was
already partially serving that function, and anyway relfilenode.h was
kind of a random place for that enum.

* So, relfilenode.h now includes relpath.h rather than vice-versa.  This
direction of dependency is fine.  (That allows most, but not quite all,
of the existing explicit #includes of relpath.h to go away again.)

* Push forkname_to_number from catalog.c to relpath.c, just to centralize
fork number stuff a bit better.

* Push GetDatabasePath from catalog.c to relpath.c; it was rather odd
that the previous commit didn't keep this together with relpath().

* To avoid needing relfilenode.h in common/, redefine the underlying
function (now called GetRelationPath) as taking separate OID arguments,
and make the APIs using RelFileNode or RelFileNodeBackend into macro
wrappers.  (The macros have a potential multiple-eval risk, but none of
the existing call sites have an issue with that; one of them had such a
risk already anyway.)

* Fix failure to follow the directions when "init" fork type was added;
specifically, the errhint in forkname_to_number wasn't updated, and neither
was the SGML documentation for pg_relation_size().

* Fix tablespace-path-too-long check in CreateTableSpace() to account for
fork-name component of maximum-length pathnames.  This requires putting
FORKNAMECHARS into a header file, but it was rather useless (and
actually unreferenced) where it was.

The last couple of items are potentially back-patchable bug fixes,
if anyone is sufficiently excited about them; but personally I'm not.

Per a gripe from Christoph Berg about how include/common wasn't
self-contained.
2014-04-30 17:30:50 -04:00
..
Makefile Split out rmgr rm_desc functions into their own files 2012-11-28 13:01:15 -03:00
clogdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
dbasedesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
gindesc.c Rewrite the way GIN posting lists are packed on a page, to reduce WAL volume. 2014-03-31 15:23:50 +03:00
gistdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
hashdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
heapdesc.c Introduce logical decoding. 2014-03-03 16:32:18 -05:00
mxactdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
nbtdesc.c Cleanup of new b-tree page deletion code. 2014-04-23 10:19:54 +03:00
relmapdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
seqdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
smgrdesc.c Rationalize common/relpath.[hc]. 2014-04-30 17:30:50 -04:00
spgdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
standbydesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
tblspcdesc.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
xactdesc.c Rationalize common/relpath.[hc]. 2014-04-30 17:30:50 -04:00
xlogdesc.c Rationalize common/relpath.[hc]. 2014-04-30 17:30:50 -04:00