Re: Patch: regschema OID type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: David Christensen <david(at)endpoint(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: regschema OID type
Date: 2010-01-21 18:06:20
Message-ID: 11062.1264097180@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2010-01-21 18:11:01 Re: Patch: regschema OID type
Previous Message David Christensen 2010-01-21 18:06:18 Re: MySQL-ism help patch for psql