X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 56BC19DCC15 for ; Thu, 9 Feb 2006 05:35:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94590-06-3 for ; Thu, 9 Feb 2006 05:35:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svana.org (svana.org [125.62.94.225]) by postgresql.org (Postfix) with ESMTP id 5AC759DC991 for ; Thu, 9 Feb 2006 05:35:39 -0400 (AST) Received: from kleptog by svana.org with local (Exim 4.50) id 1F78DF-0003qa-3o; Thu, 09 Feb 2006 20:35:41 +1100 Date: Thu, 9 Feb 2006 10:35:41 +0100 From: Martijn van Oosterhout To: Tom Lane Cc: pgsql-hackers@postgreSQL.org, cgg007@yahoo.com Subject: Re: Schema search for default operator classes (was: [ADMIN] Cross schema Primary Key Indexes problem with datatype in the public schema) Message-ID: <20060209093541.GB14457@svana.org> Reply-To: Martijn van Oosterhout References: <20060208195933.6993.qmail@web32515.mail.mud.yahoo.com> <22538.1139450686@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hQiwHBbRI9kgIhsi" Content-Disposition: inline In-Reply-To: <22538.1139450686@sss.pgh.pa.us> X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: User-Agent: Mutt/1.5.9i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kleptog@svana.org X-SA-Exim-Scanned: No (on svana.org); SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.13 required=5 tests=[AWL=0.130] X-Spam-Score: 0.13 X-Spam-Level: X-Archive-Number: 200602/289 X-Sequence-Number: 79427 --hQiwHBbRI9kgIhsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2006 at 09:04:46PM -0500, Tom Lane wrote: > http://archives.postgresql.org/pgsql-admin/2006-02/msg00084.php > reports a problem with default btree operator classes that are > not in pg_catalog: you can create a UNIQUE or PRIMARY KEY constraint > that depends on such an opclass, but then when you pg_dump and > try to reload, you get something like > The only other solution I can see is to extend the ADD CONSTRAINT syntax > to allow explicit specification of an opclass for each column. This > might be a good thing to do in itself, but it looks like a new feature > to me, rather than something we could reasonably apply as a bug fix. > It would certainly be a much larger code change (affecting both pg_dump > and the backend) than changing the behavior of GetDefaultOpClass. And > it'd not fix the problem for existing dump files, either. >=20 > So I'm leaning towards removing the search-path dependency of > GetDefaultOpClass. Comments? I'm for. IMHO, if you give someone has access to the type they should have access to the supporting machinary. Whoever created the type probably also created the operator class and intended it to be used. For a comparison, we don't check the schema on looking up type input/output functions (well, we don't need to because we have the oid, but the idea is important). W.R.T. the other option (per column opclass specification), if we ever do COLLATE users will be allowed to specify it on a per-column basis anyway. Then specifying opclasses becomes redundant. I've been seriously neglecting this patch but hope to get back to it soon... Have a nice day, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. --hQiwHBbRI9kgIhsi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFD6wztIB7bNG8LQkwRAhurAJ9Pt9HovbeofSKlyfUQyXcjrDFFzACgjQYy ZRy1sRg2PwUf8FsyKa7o/wU= =owUG -----END PGP SIGNATURE----- --hQiwHBbRI9kgIhsi--