postgresql/src/backend/utils
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
..
adt Rationalize common/relpath.[hc]. 2014-04-30 17:30:50 -04:00
cache Rationalize common/relpath.[hc]. 2014-04-30 17:30:50 -04:00
error Prevent interrupts while reporting non-ERROR elog messages. 2014-03-13 20:59:42 -04:00
fmgr Fix documentation of FmgrInfo.fn_nargs. 2014-04-22 23:22:12 -04:00
hash Update copyright for 2014 2014-01-07 16:05:30 -05:00
init Make sure -D is an absolute path when starting server on Windows. 2014-04-04 18:42:13 -04:00
mb Remove wchar.c Asserts that were stricter than the main code 2014-03-24 15:59:38 -04:00
misc C comment: track_activity_query_size doesn't support memory units 2014-04-10 09:57:04 -04:00
mmgr Add an Assertion that you don't palloc within a critical section. 2014-04-04 14:28:54 +03:00
resowner Update copyright for 2014 2014-01-07 16:05:30 -05:00
sort Improve some O(N^2) behavior in window function evaluation. 2014-04-13 13:59:17 -04:00
time Fix typos in comments. 2014-03-17 20:47:28 +09:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Update copyright for 2014 2014-01-07 16:05:30 -05:00
Gen_dummy_probes.sed Update copyright for 2014 2014-01-07 16:05:30 -05:00
Gen_fmgrtab.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
generate-errcodes.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Fix build with LWLOCK_STATS or dtrace. 2014-03-21 23:26:34 +01:00