OPERATOR FAMILY and pg_dump

Started by Joe Abbateover 14 years ago3 messages
#1Joe Abbate
jma@freedomcircle.com

Hi,

If a basic operator family is created, e.g.,

create operator family of1 using btree;

shouldn't pg_dump include this in its output? If not, why?

Joe

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Abbate (#1)
Re: OPERATOR FAMILY and pg_dump

Joe Abbate <jma@freedomcircle.com> writes:

If a basic operator family is created, e.g.,
create operator family of1 using btree;
shouldn't pg_dump include this in its output? If not, why?

Quoting from the pg_dump source code:

* We want to dump the opfamily only if (1) it contains "loose" operators
* or functions, or (2) it contains an opclass with a different name or
* owner. Otherwise it's sufficient to let it be created during creation
* of the contained opclass, and not dumping it improves portability of
* the dump.

I guess if it contains no opclasses and no operators either, this code
won't dump it, but isn't it rather useless in such a case?

regards, tom lane

#3Joe Abbate
jma@freedomcircle.com
In reply to: Tom Lane (#2)
Re: OPERATOR FAMILY and pg_dump

On 09/07/2011 12:10 PM, Tom Lane wrote:

I guess if it contains no opclasses and no operators either, this code
won't dump it, but isn't it rather useless in such a case?

Yes, I think it's useless, like a book cover without the contents, but
ISTM it should still be dumped (perhaps someone started defining a
family and forgot about it--oh, the puns that come to mind).

Joe