Re: Patch: regschema OID type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch: regschema OID type
Дата
Msg-id 11062.1264097180@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch: regschema OID type  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: Patch: regschema OID type  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
"David E. Wheeler" <david@kineticode.com> writes:
> The names of schemas in which to find functions, tables, views, triggers, etc. etc. I have lots of stuff like this:

>         SELECT true
>           FROM pg_catalog.pg_namespace n
>           JOIN pg_catalog.pg_class c ON n.oid = c.relnamespace
>          WHERE c.relkind = $1
>            AND n.nspname = $2
>            AND c.relname = $3

Well, without a context that explains *why* you're doing that, it's hard
to consider what a better solution would look like.  Personally I
usually prefer solutions involving WHERE oid = 'foo.bar'::regclass,
because that scales easily to either providing or omitting the schema
reference.

If you're trying to avoid throwing an error on bad schema name,
a regschema type would not help you.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Christensen
Дата:
Сообщение: Re: MySQL-ism help patch for psql
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Patch: regschema OID type