Re: pg_settings.enumval as array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_settings.enumval as array
Date: 2008-11-21 17:59:00
Message-ID: 10015.1227290340@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> The attached patch changes pg_settings.enumval to be an array of text
> instead of just a string, per previous discussion and the open items list.

> Comments?

Hmmm ... this coding will fail if any enumval contains a double quote.
Which is probably not a big problem, but we ought to document the
restriction somewhere.

Also, this:

> ! if (len > strlen(separator)-1)
> ! /* Replace final separator */
> ! hintmsg[len-strlen(separator)] = '\0';

would read better IMHO as "if (len >= strlen(separator))".

Also, the output datatype should be text[] not cstring[].

Otherwise seems okay.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-11-21 18:00:25 Re: fmgr.h vs funcapi.h?
Previous Message Tom Lane 2008-11-21 17:24:38 Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.