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

From Peter Eisentraut
Subject Re: mapping object names to role IDs
Date
Msg-id 1274866065.4843.1.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to mapping object names to role IDs  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: mapping object names to role IDs
List pgsql-hackers
On sön, 2010-05-23 at 00:50 -0400, Robert Haas wrote:
> Oid get_<object-type>_oid(List *qualname, bool missingok);
> -or-
> Oid get_<object-type>_oid(char *name, bool missingok);
> 
> Thus get_database_oid and get_tablespace_oid would remain unchanged
> except for taking a second argument, get_roleid and get_roleid_checked
> would merge, and all of the others would change to match that style.

If you are doing some refactoring work in that area, maybe you can also
take care of the issue I talked about there:
http://archives.postgresql.org/pgsql-hackers/2008-12/msg00725.php

"""
Our code contains about 200 copies of the following code:

tuple = SearchSysCache[Copy](FOOOID, ObjectIdGetDatum(fooid), 0, 0, 0);
if (!HeapTupleIsValid(tuple))   elog(ERROR, "cache lookup failed for foo %u", fooid);
"""

It looks like your proposal would reduce that number significantly.




pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Synchronization levels in SR
Next
From: Fujii Masao
Date:
Subject: Re: Synchronization levels in SR