Re: Patch: regschema OID type

David E. Wheeler <david@kineticode.com>

From: "David E. Wheeler" <david@kineticode.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Christensen <david@endpoint.com>, pgsql-hackers@postgresql.org
Date: 2010-01-21T18:02:14Z
Lists: pgsql-hackers
On Jan 21, 2010, at 9:57 AM, Tom Lane wrote:

> Schema names of what?  It sounds to me like you're failing to use the
> existing regfoo types in appropriate places ...

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

I'd love to instead do something like:

        SELECT true
          FROM pg_catalog.pg_class c
         WHERE c.relkind = $1
           AND c.relnamespace::regschema = $2
           AND c.relname = $3

Best,

David