[HACKERS] Patch: regschema OID type

2010-01-21 Thread David Christensen
Hey -hackers, Enclosed is a patch adding a 'regschema' OID type. I'm really just hoping to get this out there, don't worry about committing it at this point. This is something that I've always wanted in the field (yes, I'm lazy). Many thanks to RhodiumToad for pointers about the

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread David E. Wheeler
On Jan 21, 2010, at 9:46 AM, David Christensen wrote: It uses the same quoting mechanism as regclass, and I've tested against some odd schema names such as fooschema; I updated the docs as I was able, but am not familiar enough with the regression tests to add those yet. I hope to address

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread Tom Lane
David Christensen da...@endpoint.com writes: Enclosed is a patch adding a 'regschema' OID type. What in the world is the point of that? The regfoo types are for things that have schema-qualified names. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: OOh, /me likey! This would save me a ton of code in pgTAP (about half its queries have to join to pg_namespace to get schema names). Schema names of what? It sounds to me like you're failing to use the existing regfoo types in appropriate places

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread David E. Wheeler
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:

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread David Christensen
On Jan 21, 2010, at 11:56 AM, Tom Lane wrote: David Christensen da...@endpoint.com writes: Enclosed is a patch adding a 'regschema' OID type. What in the world is the point of that? The regfoo types are for things that have schema-qualified names. Perhaps the naming is a bit

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread Tom Lane
David E. Wheeler da...@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

Re: [HACKERS] Patch: regschema OID type

2010-01-21 Thread David E. Wheeler
On Jan 21, 2010, at 10:06 AM, Tom Lane wrote: 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