Re: [HACKERS] MIN not defined for OID types - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] MIN not defined for OID types
Date
Msg-id 35F0C9C7.19D9FC8D@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] MIN not defined for OID types  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] MIN not defined for OID types  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> >     select min(oid) from pg_class;
> >     ERROR:  function min(oid) does not exist
> > I got this surprise while trying to optimize a hack for the
> > PostgreSQL functions in Keystone
> > (http://www.stonekeep.com/keystone).
> Is this in 6.4 or 6.3.2?  I think 6.4 may be able to do this, and if
> not, perhaps Thomas can add it.  Sounds like a good use for
> binary-compatable operators.
> Thomas, can we delete the old operators now that the binary compatable
> stuff works?  Just an idea, not sure if it is do-able.

It is do-able, but I'm not sure it is desirable. If there is an exact
function or operator match, then that would be preferred, right? The
"binary-compatible" is a cheat to help performance and to allow us to
not have to define _every_ possible combination of functions and
operators. So it's helped on some things, but probably shouldn't become
the only mechanism. For one thing, if you change the underlying
implementation of a type, then it would not longer be binary compatible
with a second one, and you would need the explicit functions and
operators anyway.

I didn't change any of the type matching behavior of the aggregate
functions that I can recall. Maybe I should have; if I have time I'll
look at it. That would probably be better than bothering to implement
something explicitly for oids:

  postgres=> select min(oid) from foo;
  ERROR:  No such function 'min' with the specified attributes

Also, it's a bit hard to get too excited about a missing feature to
allow someone to "optimize a hack" Isn't that like "patching a patch" or
"fixing a repair"? :)

                    - Tom

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] MIN not defined for OID types
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] Adding PRIMARY KEY info