bug?

Поиск
Список
Период
Сортировка
Искать
От
Joe Conway
Тема
bug?
Дата
Msg-id
3D7AEBE7.9090200@joeconway.com
Список
Дерево обсуждения
Re: bug? Joe Conway <mail@joeconway.com>
I found the following while poking around. RangeVarGetRelid takes a 
second parameter that is intended to allow it to not fail, returning 
InvalidOid instead. However it calls LookupExplicitNamespace, which does 
not honor any such request, and happily generates an error on a bad 
namespace name:

/* * RangeVarGetRelid *     Given a RangeVar describing an existing relation, *     select the proper namespace and look up the relation OID. * * If the relation is not found, return InvalidOid if failOK = true, * otherwise raise an error. */
Oid
RangeVarGetRelid(const RangeVar *relation, bool failOK)
{
[...]  if (relation->schemaname)  {    /* use exact schema given */    namespaceId = LookupExplicitNamespace(relation->schemaname);    relId = get_relname_relid(relation->relname, namespaceId);  }
[...]
}

Oid
LookupExplicitNamespace(const char *nspname)
{
[...]  namespaceId = GetSysCacheOid(NAMESPACENAME,                  CStringGetDatum(nspname),0, 0, 0);  if (!OidIsValid(namespaceId))    elog(ERROR, "Namespace \"%s\" does not exist", nspname);
[...]
}

Shouldn't LookupExplicitNamespace be changed to allow the same second 
parameter? All uses of LookupExplicitNamespace, besides in 
RangeVarGetRelid, would have the parameter set to false.

Comments?

Joe


В списке pgsql-hackers по дате отправления
От: Matthew T. O'Connor
Дата:
Сообщение: Re: --with-maxbackends
От: Michael Meskes
Дата:
Сообщение: 7.3beta and ecpg
FAQ