Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org, Andres Freund <andres@anarazel.de>
Date: 2013-01-08T19:28:14Z
Lists: pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
maxpg> From: Andres Freund <andres@anarazel.de>
> relpathbackend() (via some of its wrappers) is used in *_desc routines which we
> want to be useable without a backend environment arround.

I'm 100% unimpressed with making relpathbackend return a pointer to a
static buffer.  Who's to say whether that won't create bugs due to
overlapping usages?

> Change signature to return a 'const char *' to make misuse easier to
> detect.

That seems to create way more churn than is necessary, and it's wrong
anyway if the result is palloc'd.

			regards, tom lane


Commits

  1. Prevent creation of postmaster's TCP socket during pg_upgrade testing.