Re: pg_settings.enumval as array - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_settings.enumval as array
Date
Msg-id 10015.1227290340@sss.pgh.pa.us
Whole thread Raw
In response to pg_settings.enumval as array  (Magnus Hagander <magnus@hagander.net>)
Responses Re: pg_settings.enumval as array  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.
Next
From: Magnus Hagander
Date:
Subject: Re: fmgr.h vs funcapi.h?