X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E0818D1B20D for ; Thu, 10 Jun 2004 11:09:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41043-09 for ; Thu, 10 Jun 2004 14:09:54 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E1464D1B229 for ; Thu, 10 Jun 2004 11:09:49 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5AE9rgX024191; Thu, 10 Jun 2004 10:09:54 -0400 (EDT) To: cgg007@yahoo.com Cc: pgsql-sql@postgresql.org Subject: Re: Schema + User-Defined Data Type Indexing problems... In-reply-to: <20040610132050.94570.qmail@web13801.mail.yahoo.com> References: <20040610132050.94570.qmail@web13801.mail.yahoo.com> Comments: In-reply-to Chris Gamache message dated "Thu, 10 Jun 2004 06:20:50 -0700" Date: Thu, 10 Jun 2004 10:09:53 -0400 Message-ID: <24190.1086876593@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200406/84 X-Sequence-Number: 18029 Chris Gamache writes: > Is it even possible to create an index that lives in a different > schema from the table it is indexing? It is not --- the index always lives in the same schema as its table. However, I think that the real issue here is "where is the datatype?". I'm assuming that you created both the datatype uuid and the opclass for it in my_schema. So, when working in another schema (with my_schema not in the search path at all) you'd have had to say create table foo (my_uuid my_schema.uuid); and if you then try to make an index you'll have to say create index fooi on foo (my_uuid my_schema.uuid_ops); because no default opclass for uuid will be found in the search path. In practice I'm not sure that this is really a situation that we need to fret about, because using a datatype that isn't in your search path has got notational problems that are orders of magnitude worse than this one. The functions and operators that do something useful with the datatype would also have to be schema-qualified every time you use them. This is perhaps tolerable for functions but it's quite unpleasant for operators :-( You can't write select * from foo where my_uuid = 'xxx'; instead select * from foo where my_uuid operator(my_schema.=) 'xxx'; Yech. I think you'll end up putting uuid's schema in your search path before long anyway. regards, tom lane