Re: Exposing keywords to clients - Mailing list pgsql-patches

From Nikhils
Subject Re: Exposing keywords to clients
Date
Msg-id d3c4af540807022352w1876fe8fu60c1533396f9eb2c@mail.gmail.com
Whole thread Raw
In response to Re: Exposing keywords to clients  ("Dave Page" <dpage@pgadmin.org>)
Responses Re: Exposing keywords to clients  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Hi,

> > Attached is an updated patch, giving the following output.
>
> Oh, one other thing: dropping externs into random modules unrelated to
> their source module is completely awful programming style, because there
> is nothing preventing incompatible declarations.  Put those externs in
> keywords.h instead.

OK.

> I suspect you have ignored a compiler warning
> about not declaring pg_get_keywords itself, too --- it should be
> extern'd in builtins.h.

No, no warning (I'm using VC++ today) - but fixed anyway.

Update attached, including corrected docs. Note to self - proof read
docs *after* putting the kids to bed in future.

Here are some comments from me:

* doc/src/sgml/func.sgml

a) Changed "localised" to "localized" to be consistent with the references elsewhere in the same file.

* src/backend/utils/adt/misc.c

b) I wonder if we need the default case in the switch statement at all, since we are scanning the statically populated ScanKeywords array with proper category values for each entry.
 
c) There was a warning during compilation since we were assigning a const pointer to a char pointer
             values[0] = ScanKeywords[funcctx->call_cntr].name;

* src/include/catalog/pg_proc.h

d) oid 2700 has been claimed by another function in the meanwhile. Modified it to 2701.
DATA(insert OID = 2701 ( pg_get_keywords    PGNSP PGUID 12 10 400 f f t t s 0 2249

e) I was wondering why pronargs is set to 0 above. But I see other functions doing the same, so its ok I guess for such kinds of usages.

PFA, version 4 of this patch with a,c and d taken care of.

Regards,
Nikhils
--
EnterpriseDB http://www.enterprisedb.com
Attachment

pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: Re: [BUGS] BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Next
From: "Marko Kreen"
Date:
Subject: Re: pg_dump lock timeout