Re: pg_tablespace_databases - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: pg_tablespace_databases
Date
Msg-id 200407061115.i66BFIl14939@candle.pha.pa.us
Whole thread Raw
In response to Re: pg_tablespace_databases  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_tablespace_databases  (Gavin Sherry <swm@linuxworld.com.au>)
Re: pg_tablespace_databases  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:
> > Joe Conway wrote:
> >> 2) This allocation size was a bit ambigous and I think based on a once
> >> longer tablespace directory name:
>
> > This size calculation originated (copy/paste) from
> > commands/tablespace.c,
>
> Yeah --- Bruce did not adjust the string length calculations when he
> editorialized on the directory name.  I'd been meaning to go back and
> make them match.
>
> > should be clarified there too (and "pg_tblspc" is
> > hardcoded in strings, could be extracted to a macro definition).
>
> [ shrug... ]  The name is not going to change again.  I have never cared
> for the practice of writing strlen("foo") as if it were a compile-time
> constant.  But certainly it would be entirely pointless to define such a
> macro and then use it in only one place.

I think with gcc strlen("foo") is a compile-time constant.  At least I
remember that as a gcc optimization.  What do you prefer?
sizeof("foo")-1?  Certainly +3 is poorly documented, no?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: actualized czech FAQ
Next
From: Gavin Sherry
Date:
Subject: Re: pg_tablespace_databases