Re: Patch: regschema OID type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch: regschema OID type
Date
Msg-id 11062.1264097180@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch: regschema OID type  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: Patch: regschema OID type
List 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 by date:

Previous
From: David Christensen
Date:
Subject: Re: MySQL-ism help patch for psql
Next
From: "David E. Wheeler"
Date:
Subject: Re: Patch: regschema OID type