On 2016-11-13 11:11:37 -0500, Tom Lane wrote:
> 1. Are we going to try to keep these things in the .h files, or split
> them out? I'd like to get them out, as that eliminates both the need
> to keep the things looking like macro calls, and the need for the data
> within the macro call to be at least minimally parsable as C.
I vote for splitting them out.
> 2. Andrew's example above implies some sort of mapping between the
> keywords and the actual column names (or at least column positions).
> Where and how is that specified?
I don't know what andrew was planning, but before I stopped I had a 1:1
mapping beteween column names and keywords. Catalog.pm parses the
pg_*.h headers and thus knows the table definition via the CATALOG()
stuff.
> 3. Also where are we going to provide the per-column default values?
That's a good question, I suspect we should move that knowledge to the
headers as well. Possibly using something like BKI_DEFAULT(...)?
> How does the converter script know which columns to convert to type oids,
> proc oids, etc?
I simply had that based on the underlying reg* type. I.e. if a column
was regtype the script would map it to type oids and so on. That
required some type changes, which does have some compatibility concerns.
> Is it going to do any data validation beyond that, and if so on what basis?
Hm, not sure if we really need something.
> 4. What will we do about the #define's that some of the .h files provide
> for (some of) their object OIDs? I assume that we want to move in the
> direction of autogenerating those macros a la fmgroids.h, but this needs
> a concrete spec as well.
I suspect at least type oids we'll continue to have to maintain
manually. A good number of things rely on the builtin type oids being
essentially stable.
> > If we can generalize this to other catalogs, then that will be good, but
> > my inclination is to handle the elephant in the room (pg_proc.h) and
> > worry about the gnats later.
>
> I think we want to do them all.
+1
Greetings,
Andres Freund