Re: FUNC_MAX_ARGS benchmarks

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Joe Conway <mail(at)joeconway(dot)com>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FUNC_MAX_ARGS benchmarks
Date: 2002-08-14 05:49:06
Message-ID: 200208140549.g7E5n6I02978@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Change made.

---------------------------------------------------------------------------

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > In fact, I now see that there was no such problem. I do wonder why the
> > 32 is there, though? Shouldn't it be 6 or something like that?
>
> Whoever it was was too lazy to count accurately ;-)
>
> I guess I'd vote for changing the code to be
>
> sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1);
> if (!sys)
> return false;
> sprintf(sys, "exec '%s' '%s'", editorName, fname);
>
> (note the added quotes to provide a little protection against spaces
> and such). Then it's perfectly obvious what the calculation is doing.
> I don't care about wasting 20-some bytes, but confusing readers of the
> code is worth avoiding.
>
> regards, tom lane
>

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-14 05:52:30 Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT
Previous Message Bruce Momjian 2002-08-14 05:45:45 Re: CLUSTER all tables at once?