Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlGwW-0006oX-LH for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Dec 2012 10:32:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TlGwV-000821-Lf for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Dec 2012 10:32:03 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlGwU-00081w-VR for pgsql-bugs@postgresql.org; Wed, 19 Dec 2012 10:32:03 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlGwT-0003Go-Fd for pgsql-bugs@postgresql.org; Wed, 19 Dec 2012 10:32:02 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TlGwS-0001Sb-II for pgsql-bugs@postgresql.org; Wed, 19 Dec 2012 10:32:01 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TlGwR-0000lm-N4 for pgsql-bugs@postgresql.org; Wed, 19 Dec 2012 10:31:59 +0000 Date: Wed, 19 Dec 2012 10:31:59 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7758: pg_dump does not correctly dump operators. To: pgsql-bugs@postgresql.org From: dmigowski@ikoffice.de X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 7758 Logged by: Daniel Migowski Email address: dmigowski@ikoffice.de PostgreSQL version: 9.1.7 Operating system: Windows, bug Linux seems also affected Description:=20=20=20=20=20=20=20=20 Hi, here is a small example of operator definitions: CREATE FUNCTION text_natsort_gt(text, text) RETURNS boolean AS 'SELECT bttext_pattern_cmp($1,$2) > 0' LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION text_natsort_lt(text, text) RETURNS boolean AS 'SELECT bttext_pattern_cmp($1,$2) < 0' LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE OPERATOR #<#( PROCEDURE =3D text_natsort_lt, LEFTARG =3D text, RIGHTARG =3D text, COMMUTATOR =3D #>#, RESTRICT =3D scalarltsel, JOIN =3D scalarltjoinsel); CREATE OPERATOR #>#( PROCEDURE =3D text_natsort_gt, LEFTARG =3D text, RIGHTARG =3D text, COMMUTATOR =3D #<#, RESTRICT =3D scalargtsel, JOIN =3D scalargtjoinsel); When inserted into an empty DB on an 9.1.2 system, then pg_dump will generate wrong CUMMUTATOR clauses, but only for the first operator: CREATE OPERATOR #<# ( PROCEDURE =3D text_natsort_lt, LEFTARG =3D text, RIGHTARG =3D text, COMMUTATOR =3D 705344, RESTRICT =3D scalarltsel, JOIN =3D scalarltjoinsel ); Doing this in PostgreSQL 9.1.7 works correctly with my example: CREATE OPERATOR #<# ( PROCEDURE =3D text_natsort_lt, LEFTARG =3D text, RIGHTARG =3D text, COMMUTATOR =3D #>#, RESTRICT =3D scalarltsel, JOIN =3D scalarltjoinsel ); Sadly, when I use these operators in my real world database running on 9.1.7, the problem is still there: CREATE OPERATOR #<# ( PROCEDURE =3D text_natsort_lt, LEFTARG =3D text, RIGHTARG =3D text, COMMUTATOR =3D 1865126, RESTRICT =3D scalarltsel, JOIN =3D scalarltjoinsel ); Could you please have a look if there are cases where this bug could still have survived? I would eagerly try new versions of postgres to solve this issue, or do anything else of help (like providing a dump of my real world db without data to the developer). --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs