sorting operators in pg_dump

Started by Peter Eisentrautover 14 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Currently, pg_dump sorts operators by name, but operators with the same
name come out in random order. A few releases ago we adjusted this for
functions, so that they are in increasing number of arguments order.
I'd like to do this for operators as well, so that they come out in
order, say, prefix, postfix, infix.

(It might be surprising that something like this is necessary, but it
happens. ip4r for example contains operators with different fixnesses
(fixities?).)

Patch attached, and a little test case.

Attachments:

pg_dump-operator-sort.patchtext/x-patch; charset=UTF-8; name=pg_dump-operator-sort.patchDownload+17-0
pg_dump-operator-sort-test.sqltext/x-sql; charset=UTF-8; name=pg_dump-operator-sort-test.sqlDownload
#2Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Peter Eisentraut (#1)
Re: sorting operators in pg_dump

Peter Eisentraut <peter_e@gmx.net> writes:

order, say, prefix, postfix, infix.

(It might be surprising that something like this is necessary, but it
happens. ip4r for example contains operators with different fixnesses
(fixities?).)

I think it's called “arity” :)

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

#3Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#1)
Re: sorting operators in pg_dump

On Sun, Jan 1, 2012 at 11:50 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

Currently, pg_dump sorts operators by name, but operators with the same
name come out in random order.  A few releases ago we adjusted this for
functions, so that they are in increasing number of arguments order.
I'd like to do this for operators as well, so that they come out in
order, say, prefix, postfix, infix.

(It might be surprising that something like this is necessary, but it
happens.  ip4r for example contains operators with different fixnesses
(fixities?).)

Patch attached, and a little test case.

Seems like a good idea. The patch looks good, too.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company