From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Migowski <dmigowski@ikoffice.de>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #7758: pg_dump does not correctly dump operators.
Date: Wed, 19 Dec 2012 19:32:17 -0500
Message-ID: <25923.1355963537@sss.pgh.pa.us> (raw)
In-Reply-To: <41ED3F5450C90F4D8381BC4D8DF6BBDC729C317D@EXCHANGESERVER.ikoffice.de>
References: <E1TlGwR-0000lm-N4@wrigleys.postgresql.org>
<20158.1355944125@sss.pgh.pa.us>
<41ED3F5450C90F4D8381BC4D8DF6BBDC729C317D@EXCHANGESERVER.ikoffice.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Daniel Migowski <dmigowski@ikoffice.de> writes:
> DROP OPERATOR IF EXISTS #<#(text,text) CASCADE;
> CREATE OPERATOR #<#(
> PROCEDURE = text_natsort_lt,
> LEFTARG = text,
> RIGHTARG = text,
> COMMUTATOR = #>#,
> RESTRICT = scalarltsel,
> JOIN = scalarltjoinsel);
> DROP OPERATOR IF EXISTS #>#(text,text) CASCADE;
> CREATE OPERATOR #>#(
> PROCEDURE = text_natsort_gt,
> LEFTARG = text,
> RIGHTARG = text,
> COMMUTATOR = #<#,
> RESTRICT = scalargtsel,
> JOIN = scalargtjoinsel);
The second DROP removes the "shell" operator that was created as a
placeholder by the first operator's COMMUTATOR reference. Then when
you create the #># operator for real, it's not linked to the #<#
operator, at least not in that direction. pg_dump is not at fault
here; it's just reporting what's in the catalogs, which is to say a
dangling commutator link.
I believe we've looked at this in the past, and not found any cure
that wasn't worse than the disease. For example, if we were to treat
the first operator's COMMUTATOR reference as a hard dependency, then
the second DROP CASCADE would cascade to remove the first operator,
hardly the outcome you'd want.
My recommendation for the moment is that if you want to write the
script in this style, put all the DROPs first and then create the
operators.
regards, tom lane
--
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: tgl@sss.pgh.pa.us, dmigowski@ikoffice.de
Subject: Re: BUG #7758: pg_dump does not correctly dump operators.
In-Reply-To: <25923.1355963537@sss.pgh.pa.us>
References: <E1TlGwR-0000lm-N4@wrigleys.postgresql.org> <20158.1355944125@sss.pgh.pa.us> <41ED3F5450C90F4D8381BC4D8DF6BBDC729C317D@EXCHANGESERVER.ikoffice.de> <25923.1355963537@sss.pgh.pa.us>
* 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