From: dmigowski@ikoffice.de
To: pgsql-bugs@postgresql.org
Subject: BUG #7758: pg_dump does not correctly dump operators.
Date: Wed, 19 Dec 2012 10:31:59 +0000
Message-ID: <E1TlGwR-0000lm-N4@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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:
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 = text_natsort_lt,
LEFTARG = text,
RIGHTARG = text,
COMMUTATOR = #>#,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR #>#(
PROCEDURE = text_natsort_gt,
LEFTARG = text,
RIGHTARG = text,
COMMUTATOR = #<#,
RESTRICT = scalargtsel,
JOIN = 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 = text_natsort_lt,
LEFTARG = text,
RIGHTARG = text,
COMMUTATOR = 705344,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
Doing this in PostgreSQL 9.1.7 works correctly with my example:
CREATE OPERATOR #<# (
PROCEDURE = text_natsort_lt,
LEFTARG = text,
RIGHTARG = text,
COMMUTATOR = #>#,
RESTRICT = scalarltsel,
JOIN = 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 = text_natsort_lt,
LEFTARG = text,
RIGHTARG = text,
COMMUTATOR = 1865126,
RESTRICT = scalarltsel,
JOIN = 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).
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: dmigowski@ikoffice.de
Subject: Re: BUG #7758: pg_dump does not correctly dump operators.
In-Reply-To: <E1TlGwR-0000lm-N4@wrigleys.postgresql.org>
References: <E1TlGwR-0000lm-N4@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox