Re: mapping object names to role IDs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: mapping object names to role IDs
Date
Msg-id 11363.1274881553@sss.pgh.pa.us
Whole thread Raw
In response to Re: mapping object names to role IDs  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: mapping object names to role IDs
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I still feel that we'd be better off putting all the functions that
> use the same design pattern in a single file, rather than spreading
> them out all over the backend.  It's true that that one file will then
> depend on all the catalog stuff, but it actually can limit
> dependencies a little bit on the other end, because if someone wants
> to call a bunch of these functions from the same file, they only need
> to include the one header where they are all declared,

This is nonsense, because the call sites are going to be places that are
actually *doing* something with that catalog, and so will need not only
the catalog .h file but any other support functions associated with
doing work on that catalog.  Centralizing the lookups will do nothing
whatsoever to reduce dependencies; it'll just create a central file
dependent on everything in addition to every dependency we have now.

The closest equivalent we have now is lsyscache.c, which is not exactly
a sterling example of how to design a module: it's got no conceptual
consistency whatsoever.

I'm for standardizing the API of lookup functions, but not for
relocating them.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Giles Lean
Date:
Subject: Re: libpq, PQexecPrepared, data size sent to FE vs. FETCH_COUNT
Next
From: Tom Lane
Date:
Subject: Re: ExecutorCheckPerms() hook